135
www.keyestudio.com
//right
digitalWrite(ML_Ctrl,LOW);//set the direction control pin of A motor to
LOW level
analogWrite(ML_PWM,200);//set the PWM control speed of A motor to
200
digitalWrite(MR_Ctrl,HIGH);// set the direction control pin of B motor to
HIGH level
analogWrite(MR_PWM,200);//set the PWM control speed of B motor to
200
delay(2000);//delay in 2000ms
//stop
analogWrite(ML_PWM,0);//set the PWM control speed of A motor to 0
analogWrite(MR_PWM,0);//set the PWM control speed of B motor to 0
delay(2000);// delay in 2000ms
}
//****************************************************************************
(7) Test Result:
Hook up by connection diagram, upload code and power on, the smart car
goes forward and back for 2s, turns left and right for 2s, stops for 2s and
alternately.
Содержание Smart Little Turtle Robot V3
Страница 5: ...5 www keyestudio com 1 Introduction...
Страница 16: ...16 www keyestudio com...
Страница 17: ...17 www keyestudio com...
Страница 18: ...18 www keyestudio com...
Страница 19: ...19 www keyestudio com...
Страница 22: ...22 www keyestudio com...
Страница 24: ...24 www keyestudio com...
Страница 25: ...25 www keyestudio com...
Страница 26: ...26 www keyestudio com...
Страница 28: ...28 www keyestudio com...
Страница 29: ...29 www keyestudio com...
Страница 30: ...30 www keyestudio com...
Страница 31: ...31 www keyestudio com Step 7 Hook up Guide...
Страница 32: ...32 www keyestudio com...
Страница 33: ...33 www keyestudio com...
Страница 44: ...44 www keyestudio com...
Страница 48: ...48 www keyestudio com 4 Arduino IDE Setting Click icon open Arduino IDE...
Страница 53: ...53 www keyestudio com Set board and COM port the corresponding board and COM port are...
Страница 54: ...54 www keyestudio com shown on the lower right of IDE Click to start compiling the program check errors...
Страница 55: ...55 www keyestudio com Click to upload the program upload successfully...
Страница 59: ...59 www keyestudio com...
Страница 60: ...60 www keyestudio com Then the libraries of turtle robot are installed successfully as shown below...
Страница 61: ...61 www keyestudio com 7 Projects The whole project begins with basic program Starting from simple to...
Страница 77: ...77 www keyestudio com 4 Connection Diagram 5 Test Code keyestudio smart turtle robot lesson 3 1...
Страница 96: ...96 www keyestudio com 5 Connection Diagram...
Страница 121: ...121 www keyestudio com 6 Then pop up the following page...
Страница 122: ...122 www keyestudio com 7 Click Read Notify WriteWithoutResponse to enter the following page...
Страница 124: ...124 www keyestudio com 10 Then click Write and open serial monitor to view if there is a 0 signal...
Страница 129: ...129 www keyestudio com...
Страница 143: ...143 www keyestudio com The definition inner pins are shown below...
Страница 159: ...159 www keyestudio com 3 Connection Diagram 4 Test Code...
Страница 167: ...167 www keyestudio com 2 Hook up Diagram...
Страница 187: ...187 www keyestudio com 8 8 LED matrix shows rightward icon Flow Chart 2 Hook up Diagram...
Страница 200: ...200 www keyestudio com 5 Click to enter the main page of turtle smart car...