From 7b658714de746b9c3da1e05157413942d349ff1b Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 12 Sep 2008 16:35:07 +0000 Subject: copying Firmata-0.4beta2 release into trunk, then I'll adjust it to Arduino-0012 --- .../Firmata/examples/EchoString/EchoString.pde | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 libraries/Firmata/examples/EchoString/EchoString.pde (limited to 'libraries/Firmata/examples/EchoString/EchoString.pde') diff --git a/libraries/Firmata/examples/EchoString/EchoString.pde b/libraries/Firmata/examples/EchoString/EchoString.pde new file mode 100644 index 0000000..ed13ad8 --- /dev/null +++ b/libraries/Firmata/examples/EchoString/EchoString.pde @@ -0,0 +1,40 @@ +/* This sketch accepts strings and raw sysex messages and echos them back. + * + * This example code is in the public domain. + */ +#include + +byte analogPin; + +void stringCallback(char *myString) +{ + Firmata.sendString(myString); +} + + +void sysexCallback(byte command, byte argc, byte*argv) +{ + Serial.print(START_SYSEX, BYTE); + Serial.print(command, BYTE); + for(byte i=0; i