Keyestudio Smart Little Turtle Robot V3 Manual page 160

Table of Contents

Advertisement

www.keyestudio.com
/*
keyestudio smart turtle robot
lesson 10
Thacking turtle
http://www.keyestudio.com
*/
int left_ctrl =
2;//define direction control pin of A motor
int left_pwm =
int right_ctrl =
4;//define direction control pin of B motor
int right_pwm =
int sensor_l =
6;//define the pin of left line tracking sensor
int sensor_c =
7;//define the pin of middle line tracking sensor
int sensor_r =
8;//define the pin of right line tracking sensor
int
l_val,c_val,r_val;//define these variables
void setup() {
Serial.begin(9600);//start serial monitor and set baud rate to 9600
pinMode(left_ctrl,OUTPUT);//set direction control pin of A motor to
OUTPUT
pinMode(left_pwm,OUTPUT);//set PWM control pin of A motor to
OUTPUT
9;//define PWM control pin of A motor
5;//define PWM control pin of B motor
160

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents