Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Servo.h>
- Servo ms1;
- int switch = 6;
- int button = 0;
- int lastButton3= 0;
- void setup (){
- Serial.begin (9600);
- ms1.attach (3);
- }
- void loop(){
- button = digitalRead(switch);
- if (button != lastButton)
- {
- if (button == HIGH)
- {
- ms1.write(0);
- delay (500);
- ms1.write (180);
- delay (500);
- }
- else
- {
- Serial.println("OFF");
- }
- delay(500);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement