I was trying to upload my sketch involving the servo library when I got this error message:
[color=red]In file included from Bot.cpp:8:
C:\[deleted because this stuff reveals personal info]\Arduino\hardware\arduino\cores\arduino/WProgram.h:18: error: expected ',' or '...' before numeric constant[/color]
Because Arduino puts some declarations at the top of your compile, line numbers displayed with error messages are usually one higher than the line number in your code. If you provide all of the code perhaps someone can determine how to get it compiled.
Are you using Arduino 1.0? Wprogram.h was replaced with Arduino.h in 1.0.
johnwasser:
Because Arduino puts some declarations at the top of your compile, line numbers displayed with error messages are usually one higher than the line number in your code. If you provide all of the code perhaps someone can determine how to get it compiled.
You are running into an obscure error caused by the way the IDE converts the sketch into a .cpp file.
A workaround is to put this line of code at the very front of your sketch:
char junk;
Pete
P.S. This ought to be a "sticky" subject but the problem is that it causes all sorts of weird errors which don't seem to be related to the real cause.
The fix, and generally better programming practice, is to use a constant integer:
Another solution is to not ignore the convention that #define names should be all upper case. L and l are not the same, so the problem would not have occurred.