1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

SPI library to the new format and moved Robot_Motor and Robot_Control libraries

This commit is contained in:
Fede85
2013-07-03 22:00:02 +02:00
parent 87d3b4f56b
commit 2371e2ce0d
98 changed files with 14 additions and 216 deletions

View File

@ -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);
}

View File

@ -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();
}