Advertisement
Guest User

Lumen Light Test

a guest
Mar 7th, 2017
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <Servo.h>
  2. int button = 7;
  3. byte servoPin = 9;
  4. int buttonS = 0;
  5. Servo servo;
  6.  
  7. void setup() {
  8. digitalWrite(button, INPUT);
  9. servo.attach(servoPin);
  10.  
  11. servo.writeMicroseconds(1100);
  12. Serial.begin(9600); // initialize serial communication at 9600 bits per second:
  13. }
  14.  
  15. void loop() {
  16.  
  17. buttonS = digitalRead(button);
  18.  
  19. if (buttonS = HIGH) {
  20. int signal = 1700;
  21. servo.writeMicroseconds(signal);
  22. }
  23. else (buttonS = LOW); {
  24. servo.writeMicroseconds(1100);
  25. }
  26. Serial.println(buttonS); // print out the state of the button:
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement