As the title suggests, I have many "expected `)' before ';' token" errors. The issue is, I have this stuff in. So now I am confused, why am I getting this if the things are there.

I am new here and had an issue with adding code, so here is the pastebin link to it: http://pastebin.com/4WXxsXkB

And here is the the pastebin link to the error: http://pastebin.com/QyehP86M

Does anyone understand how this could happen?

  • 2
    #defines do not have a ';' after them try removing these Nov 4 '14 at 19:37

You have two #define statements at the top of your code

#define trigPin 3; 
#define echoPin 2;

The way #define works is that it replaces every instance of the name with everything after it on the line so trigPin is being replaced with 3; as opposed to 3 as intended.

Fixing this should solve some of your problems.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.