element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Arduino Sketch Question???
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 7 replies
  • Subscribers 408 subscribers
  • Views 499 views
  • Users 0 members are here
  • i/o
  • expected_declaration_before_'}'_token
  • help
  • buggy
  • sketch
  • io
  • expected_unqualified-id_before_'else'
  • code
  • bug
  • error
  • arduino
  • question
Related

Arduino Sketch Question???

fechrxy
fechrxy over 12 years ago

Hey, can anyone tell me why i am getting this error in my code as opposed to this other guy's code which is very similar?

I uploaded pictures of the bottom half of the code but i can provide additional information if needed. 

I would love to know how to fix the error,  Thanks!

Attachments:
image
image
  • Sign in to reply
  • Cancel

Top Replies

  • ntewinkel
    ntewinkel over 12 years ago +1
    I can't really tell without the rest of the code, but first thing to check is to make sure RELAY is defined somewhere.
  • Former Member
    Former Member over 12 years ago in reply to billabott +1
    > does not allow me or others to put the sketch into our arduino IDE and compile the sketch . where's the sport in that?
  • fechrxy
    fechrxy over 12 years ago +1
    Hey guys, i'm really sorry i did'nt upload the full sketch however i did fix the prblem by deleting all of my notes in the sketch. Thanks so much for your feedback. Cheers!
  • ntewinkel
    0 ntewinkel over 12 years ago

    I can't really tell without the rest of the code, but first thing to check is to make sure RELAY is defined somewhere.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago

    Tony,

         In the code you haven't shown us, look for an unwanted semicolon at the end of the line,

    just before a '{' such as

          void setup();

    {

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • billabott
    0 billabott over 12 years ago

    What version of Arduino hardware are you using?  Which digital pin that supports PWM is the Relay connected to?

     

    Are we to assume that your relay is connected as the standard LED?  and will only draw 20 mA or less and have diode protection from back EMF?  not to mention the need for pullup resistor of the proper value; internal or external!

     

    int ledPin = 13;                 // LED connected to digital pin 13


    void setup()

    {

      pinMode(ledPin, OUTPUT);      // sets the digital pin as output

    }

     

    One more note: Providing a .jpg image of a sketch segment does not allow me or others to put the sketch into our arduino IDE and compile the sketch.  I am just not that interested in retyping some sketch.  Only a complete sketch would be suitable for testing changes that may solve the difficulty.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to billabott

    > does not allow me or others to put the sketch into our arduino IDE and compile the sketch.

     

    where's the sport in that?

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • fechrxy
    0 fechrxy over 12 years ago

    Hey guys, i'm really sorry i did'nt upload the full sketch however i did fix the prblem by deleting all of my notes in the sketch. Thanks so much for your feedback. Cheers!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • roineust
    0 roineust over 12 years ago

    Hello Arduino guys!

     

    This is the first time ever, that i am entering an arduino forum and there are so many options around here, i am not even sure that i am posting my question in the right place - if i am not, can you please explain or send me links or keywords for the correct pages? Thanks a lot!

     

    Here is my question:

     

     

     

    I am trying to build a robot, that uses the "Bluecontrol" android application.

     

     

    Here is the Bluecontrol app on google play:

     

    https://play.google.com/store/apps/details?id=com.gundel.bluecontrol&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5ndW5kZWwuYmx1ZWNvbnRyb2wiXQ..

     

    The robot, called "MegaPed", building instructions and arduino sketch are detailed onwww.instructables.com, on this page:

     

    http://www.instructables.com/id/MegaPed/

     

    I have done everything exactly according to written and drawn instructions on that page, with only one change:

     

    I have switched this BlueSMiRF bluetooth module, which is quite expensive:

     

    http://www.amazon.com/SparkFun-Bluetooth-Modem-BlueSMiRF-Silver/dp/B004GTUI76/ref=sr_1_5?s=electronics&ie=UTF8&qid=1332730295&sr=1-5

     

    With this JY-MCU Arduino Bluetooth Wireless Serial Port Module:

     

    http://www.ebay.com/itm/251258723414?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

     


    Now, my problem is, that after uploading the sketch - My android smartphone, is trying to connect with the bluetooth module, but shows that the module (called "linvor" on the smartphone screen) is: "Paired but not connected" - And i am unable to proceed and control the robot from the Bluecontrol application.

     

    Maybe you can help me solve this problem or refer me to someone who might help me to solve this problem?

     

    Thanks a lot,
    Roi Neustadt.

     


    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to roineust

    Thank you for the heads up on the Bluecontrol.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube