Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Servo.h>
- Servo myServo;
- int const potPin = A0;
- int potVal;
- int angle;
- void setup()
- {
- // put your setup code here, to run once:
- myServo.attach(9);
- Serial.begin(9600);
- }
- void loop()
- {
- // put your main code here, to run repeatedly:
- for(int angle= 0; angle <180; angle++)
- {
- myServo.write(angle);
- delay(15);
- }
- for(int angle= 179; angle >0; angle--)
- {
- myServo.write(angle);
- delay(15);
- }
- }
Add Comment
Please, Sign In to add comment