Test Code1 - Keyestudio Ks0428 Manual

Table of Contents

Advertisement

www.keyestudio.com

(5) Test Code1

/*
keyestudio Mini Tank Robot V2
lesson 4.1
Servo
http://www.keyestudio.com
*/
#define servoPin 9 //servo Pin
int pos; //angle variable of servo
int pulsewidth; // pulse width variable of servo
void setup() {
pinMode(servoPin, OUTPUT); //set servo pin to OUTPUT
procedure(0); //set the angle of servo to 0°
}
void loop() {
for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to
180 degrees
// in steps of 1 degree
procedure(pos);
variable 'pos'
delay(15);
// tell servo to go to position in
//control the rotation speed of
95

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Ks0428 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents

Save PDF