[Solved]I need help with an error with no answers

ive been learning arduino for a week now and this is little error has me completely stuck, i cant find an answer anywhere so here we are, ive clearly definened buttonOld on the top, someone help

You have an extra } just before that line. That } marks the end of loop(), so the line with the error is not inside any function, causing the error.

Spotting extra or missing { or } is not easy for a beginner, so here are some tips:

  1. Use Tools->Auto Format often. If, after clicking that, your last } has any spaces to the left of it, you have a missing } somewhere. If you have two } that neither have spaces to the left of them, like your sketch above on lines 26 and 29, then you have an extra } that is not needed.
  2. If you put the cursor next to a { or }, the IDE will highlight the corresponding } or {. This will help you understand which } belongs to which { and vice versa.

Also, you should know that you should not post code or error messages as a screen capture. Post the code as text into your post between code tags. Same for error messages. There is a button to copy the error messages at the top right corner of the error messages pane.

Welcome to the forum

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

..and your next problem is a superfluous semicolon on your if.

Please remember to use code tags when posting code

Screenshots of errors are (in general) useless; there is often more than you can see in the black window at the bottom. Use the button at the right hand side in the orange bar to copy the errors and next past them here using code tags.
image

Screenshots of code are just as useless; do you expect us to type it all to see if we can reproduce the error? And what if it no longer fits on a screen? So post as described in the earlier posts and in the link that UKHeliBob posted.

Not really all that clear from a screen shot but if you'd format your code you'd see that the { and the } and all wonked up.

Alright thanks man, ill keep that in mind when i get back home to edit my code, also literally first time poster on this thing so idk whats useful information and whats not, for those that were complaining about me not posting the error messages

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.