File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 1
1
/* Motor Board IR Array Test
2
-
3
- This example of the Arduno robot's motor board returns the
4
- values read fron the 5 infrared sendors on the bottom of
2
+
3
+ This example of the Arduno robot's motor board returns the
4
+ values read fron the 5 infrared sendors on the bottom of
5
5
the robot.
6
6
7
7
*/
8
- // include the motor board header
8
+ // include the motor board header
9
9
#include < ArduinoRobotMotorBoard.h>
10
10
11
11
String bar; // string for storing the informaton
12
12
13
- void setup (){
13
+ void setup () {
14
14
// start serial communication
15
15
Serial.begin (9600 );
16
16
// initialize the library
17
17
RobotMotor.begin ();
18
18
}
19
- void loop (){
20
- bar= String (" " ); // empty the string
19
+ void loop () {
20
+ bar = String (" " ); // empty the string
21
21
// read the sensors and add them to the string
22
- bar= bar+ RobotMotor.IRread (1 )+ ' ' + RobotMotor.IRread (2 )+ ' ' + RobotMotor.IRread (3 )+ ' ' + RobotMotor.IRread (4 )+ ' ' + RobotMotor.IRread (5 );
22
+ bar = bar + RobotMotor.IRread (1 ) + ' ' + RobotMotor.IRread (2 ) + ' ' + RobotMotor.IRread (3 ) + ' ' + RobotMotor.IRread (4 ) + ' ' + RobotMotor.IRread (5 );
23
23
// print out the values
24
24
Serial.println (bar);
25
25
delay (100 );
Original file line number Diff line number Diff line change 1
1
/* Motor Core
2
2
3
3
This code for the Arduino Robot's motor board
4
- is the stock firmware. program the motor board with
4
+ is the stock firmware. program the motor board with
5
5
this sketch whenever you want to return the motor
6
6
board to its default state.
7
-
7
+
8
8
*/
9
9
10
10
#include < ArduinoRobotMotorBoard.h>
11
11
12
- void setup (){
12
+ void setup () {
13
13
RobotMotor.begin ();
14
14
}
15
- void loop (){
15
+ void loop () {
16
16
RobotMotor.parseCommand ();
17
17
RobotMotor.process ();
18
18
}
You can’t perform that action at this time.
0 commit comments