EasyManua.ls Logo

Eckstein komponente KS0530 - Page 136

Default Icon
160 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
136
delay(20 - pulsewidth / 1000);
}
}
//***********************************************************************
***********
After uploading the test code, the servo rotate at 0°,90° and 180°
alternatively.
There is an easier way to control the servo that is use the servo library file
of Arduino. The following link is for your reference:
https://www.arduino.cc/en/Reference/Servo
(6) Test Code2:
Library file is used but the connection diagram remains the same.
/*
keyestudio sun_follower
lesson 9.2
servo
http://www.keyestudio.com
*/
#include <Servo.h> //include the library code:
Servo myservo;