We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi all,
I'm newbie here and I'm confused because I've followed all steps to have processing / arduino running here, but still I'm getting unexpected errors.
The top of the code:
// Maurice Ribble
// 6-28-2009
// http://www.glacialwanderer.com/hobbyrobotics
#define AI0 0
#define AI1 1
#define AI2 2
#define AI3 3
#define AI4 4
#define AI5 5
void setup()
{
Serial.begin(115200);
}
ERROR: unexpected token: def on line 5 #define AI0 0
I've installed the Android Mode but it seems not to recognize the arduino syntax.
Any help would be appreciated.
Thanks.
Answers
Android Mode uses a Java-like syntax too. Arduino uses a C-like syntax instead! b-(
You cannot use #define in processing as GoToLoop said processing is based on top of java. If you want to use processing with arduino check the serial examples
http://www.processing.org/reference/libraries/serial/
.if these are simple constants you can replace them with
public static Integer AI0 = 0;
(replace Integer with the required type)
For Java-equivalent for
#define
performance-wise, we gotta usefinal
for primitive & String! :-BAnd while we're at it, slap a
static
as well! :)>-mmm I guess i got crazy, I setup the Android mode in Processing, thinking on Arduino mode XD
thanks ;)