Test Code2 - Keyestudio Ks0428 Manual

Table of Contents

Advertisement

www.keyestudio.com
180°
There is another guide for restraining servo---- servo library file, the
following link of official website is for your reference.
https://www.arduino.cc/en/Reference/Servo
The library file of servo is used in the following code

(6) Test Code2

/*
keyestudio Mini Tank Robot V2
lesson 4.2
servo
http://www.keyestudio.com
*/
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0;
// variable to store the servo position
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo
object
}
97

Advertisement

Table of Contents
loading

Table of Contents