Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Servo.h>
- Servo myservo;
- void setup() {
- pinMode(8, INPUT);
- myservo.attach(9);
- }
- void loop() {
- int val = digitalRead(8);
- if (val == HIGH){
- myservo.write(80);
- }
- else if (val == LOW){
- myservo.write(138);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement