
82
www.keyestudio.com
int val_L,val_R,val_M;// define the variables of three sensors
void setup()
{
Serial.begin(9600); // initialize serial communication at 9600 bits per
second
pinMode(L_pin,INPUT); // make the L_pin as an input
pinMode(M_pin,INPUT); // make the M_pin as an input
pinMode(R_pin,INPUT); // make the R_pin as an input
pinMode(3, OUTPUT);
}
void loop()
{
val_L = digitalRead(L_pin);//read the L_pin:
val_R = digitalRead(R_pin);//read the R_pin:
val_M = digitalRead(M_pin);//read the M_pin:
Serial.print("left:");
Serial.print(val_L);
Serial.print(" middle:");
Serial.print(val_M);
Serial.print(" right:");
Summary of Contents for Smart Little Turtle Robot V3
Page 5: ...5 www keyestudio com 1 Introduction...
Page 16: ...16 www keyestudio com...
Page 17: ...17 www keyestudio com...
Page 18: ...18 www keyestudio com...
Page 19: ...19 www keyestudio com...
Page 22: ...22 www keyestudio com...
Page 24: ...24 www keyestudio com...
Page 25: ...25 www keyestudio com...
Page 26: ...26 www keyestudio com...
Page 28: ...28 www keyestudio com...
Page 29: ...29 www keyestudio com...
Page 30: ...30 www keyestudio com...
Page 31: ...31 www keyestudio com Step 7 Hook up Guide...
Page 32: ...32 www keyestudio com...
Page 33: ...33 www keyestudio com...
Page 44: ...44 www keyestudio com...
Page 48: ...48 www keyestudio com 4 Arduino IDE Setting Click icon open Arduino IDE...
Page 53: ...53 www keyestudio com Set board and COM port the corresponding board and COM port are...
Page 55: ...55 www keyestudio com Click to upload the program upload successfully...
Page 59: ...59 www keyestudio com...
Page 96: ...96 www keyestudio com 5 Connection Diagram...
Page 121: ...121 www keyestudio com 6 Then pop up the following page...
Page 122: ...122 www keyestudio com 7 Click Read Notify WriteWithoutResponse to enter the following page...
Page 129: ...129 www keyestudio com...
Page 143: ...143 www keyestudio com The definition inner pins are shown below...
Page 159: ...159 www keyestudio com 3 Connection Diagram 4 Test Code...
Page 167: ...167 www keyestudio com 2 Hook up Diagram...
Page 187: ...187 www keyestudio com 8 8 LED matrix shows rightward icon Flow Chart 2 Hook up Diagram...
Page 200: ...200 www keyestudio com 5 Click to enter the main page of turtle smart car...