goooooopen / cellbots

Automatically exported from code.google.com/p/cellbots
0 stars 0 forks source link

Multi-byte Commands To Arduino #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Add to the Arduino command interpreter to read into a buffer until it
receives a \n char. 

This will allow for more advanced commands like 'leftWheel=100' and a
configuration command. 

Original issue reported on code.google.com by glen.arrowsmith on 1 Apr 2010 at 8:46

GoogleCodeExporter commented 9 years ago
They can be up to 20 characters long (configurable) but must end with a ';' or 
a '\n'.

The new code is non-blocking so you can send half a command and the robot will
continue to loop the loop() and it will remember the first half of the command 
when
you send the rest and proceed to parse it.

I had to modify the Android code to append a ';' char to the end of each 
command as
the Arduino doesnt seem to get the \n char from the android.

If using the Arduino serial monitor, remember to add the ';' to the end of each
command as it doesn't send a \n.

Original comment by glen.arrowsmith on 8 Apr 2010 at 11:31