Friday, December 6, 2013

November 21 - Rigth and Left Turn

Next, we test the RC's right and left turn. Under the Arduino program library "Simple - Blink" example. We test right and left turn. Here's a rough sketch of the code we use to test right and left. We used the same coding for left turn:
/*
Blink
Turn to the righ on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
// Pin 8 will turn the RC to the right
// give it a name:
int led = 8;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(right, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(right, HIGH); // turn to the righ on
delay(1000); // wait for a second
digitalWrite(right, LOW); // turn back to position
delay(1000); // wait for a second
}
view raw Left&Right Turn hosted with ❤ by GitHub

No comments:

Post a Comment