89
www.keyestudio.com
delay(15);
}
}
//function to control servo
void procedure(int myangle) {
pulsewidth = myangle * 11 + 500; //calculate the value of pulse width
digitalWrite(servoPin,HIGH);
delayMicroseconds(pulsewidth);
//The duration of high level is pulse
width
digitalWrite(servoPin,LOW);
delay((20 - pulsewidth / 1000)); //the cycle is 20ms, the low level last for
the rest of time
}
//****************************************************************************
Upload code successfully, servo swings back in the range of 0° to 180°
There is another guide for restraining servo---- servo library file, the
following link of official website is for your reference.
Содержание 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...