diff options
| author | Cristian Maglie <c.maglie@bug.st> | 2013-05-29 18:30:36 +0200 | 
|---|---|---|
| committer | Cristian Maglie <c.maglie@bug.st> | 2013-05-29 18:30:36 +0200 | 
| commit | d90fcca5839d13d57ed527d4009b78d22dafbde7 (patch) | |
| tree | 768b98af21e5075846184dd3de41ae0c22e75e20 /libraries/Robot_Motor/examples | |
| parent | 7207108255a772474b322151cb0fd113e8030afe (diff) | |
| parent | ef4e8c65373f531ce6d37ff226a21fc9b358ff29 (diff) | |
Merged 1.0.5
Diffstat (limited to 'libraries/Robot_Motor/examples')
| -rw-r--r-- | libraries/Robot_Motor/examples/Robot_IR_Array_Test/Robot_IR_Array_Test.ino | 26 | ||||
| -rw-r--r-- | libraries/Robot_Motor/examples/Robot_Motor_Core/Robot_Motor_Core.ino | 18 | 
2 files changed, 44 insertions, 0 deletions
diff --git a/libraries/Robot_Motor/examples/Robot_IR_Array_Test/Robot_IR_Array_Test.ino b/libraries/Robot_Motor/examples/Robot_IR_Array_Test/Robot_IR_Array_Test.ino new file mode 100644 index 0000000..e201fd9 --- /dev/null +++ b/libraries/Robot_Motor/examples/Robot_IR_Array_Test/Robot_IR_Array_Test.ino @@ -0,0 +1,26 @@ +/* Motor Board IR Array Test +    +   This example of the Arduno robot's motor board returns the  +   values read fron the 5 infrared sendors on the bottom of  +   the robot. + +*/ +// include the motor board header  +#include <ArduinoRobotMotorBoard.h> + +String bar; // string for storing the informaton + +void setup(){ +  // start serial communication +  Serial.begin(9600); +  // initialize the library +  RobotMotor.begin(); +} +void loop(){ +  bar=String(""); // empty the string +  // read the sensors and add them to the string +  bar=bar+RobotMotor.readIR(0)+' '+RobotMotor.readIR(1)+' '+RobotMotor.readIR(2)+' '+RobotMotor.readIR(3)+' '+RobotMotor.readIR(4); +  // print out the values +  Serial.println(bar); +  delay(100); +} diff --git a/libraries/Robot_Motor/examples/Robot_Motor_Core/Robot_Motor_Core.ino b/libraries/Robot_Motor/examples/Robot_Motor_Core/Robot_Motor_Core.ino new file mode 100644 index 0000000..f74f30a --- /dev/null +++ b/libraries/Robot_Motor/examples/Robot_Motor_Core/Robot_Motor_Core.ino @@ -0,0 +1,18 @@ +/* Motor Core + +  This code for the Arduino Robot's motor board +  is the stock firmware. program the motor board with  +  this sketch whenever you want to return the motor +  board to its default state. +   +*/ + +#include <ArduinoRobotMotorBoard.h> + +void setup(){ +  RobotMotor.begin(); +} +void loop(){ +  RobotMotor.parseCommand(); +  RobotMotor.process(); +}  | 
