Keyestudio Smart Little Turtle Robot V3 Manual page 78

Table of Contents

Advertisement

www.keyestudio.com
Line Track sensor
http://www.keyestudio.com
*/
int L_pin = 6; //pins of left line tracking sensor
int M_pin = 7; //pins of middle line tracking sensor
int R_pin = 8; //pins of right line tracking sensor
int val_L,val_R,val_M;// define the variable value 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
}
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:
78

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents