Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Servo.h>
- Servo myservo; // create servo object to control a servo
- void setup()
- {
- myservo.attach(9); // attaches the servo on pin 9 to the servo object
- Serial.begin(9600);
- }
- void loop()
- {
- if(Serial.available()>0){
- byte angel=Serial.read();
- Serial.println(angel);
- myservo.write(angel);
- }
- delay(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement