error: expected unqualified-id before numeric cons

error: expected unqualified-id before numeric constant This comes up at the start of every code i write after i try to upload it What on earth does it mean ????? :o :-? :'(

It's an error like a missing semi-colon or an extra curly bracket or something similar that has got the compiler mixed-up. Can you post an example of the code that generates it?

  1. // Configre the led's
  2. int redLed = 12;
  3. int yelLed = 11;
  4. int grnLed = 10;
  5. int redManLed = 9;
  6. int grnManLed = 8;
  7. // Program variables
  8. int lightState = 0;
  9. int crossingRequestSwitchPin = 6; // The pin our crossing button is connected to
  10. int switchStatePin = 6;
  11. // Traffic Light Variables
  12. int timerDelayTime = 5000; // The ms between each light change when running in timer mode
  13. int crossingTime = 5000; 16.

This is a shot in the dark. Try...

  • Adding a blank line to the top of the file

  • Ensure there is nothing suspicious at the bottom of the file

  • Using /**/ for comments instead of //

  • If you can, open the file in a different editor an ensure the line terminators are consistent (all CR or all CRLF)

Good luck, Brian

Are you putting line numbers in the code?

Yes, Tommy95 is putting line numbers in his code, I just ran a test
with his code as presented. He needs to upgrade to TommyXP or
TommyVista. :slight_smile:

Tom, remove the line numbers – they are not needed nor desired!

Thanks all i took out the numbers and uploaded the code again it all workes now :)