Advertisement
Guest User

Lumen Light Test

a guest
Mar 7th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 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. pinMode(button, INPUT);
  9. servo.attach(servoPin);
  10. servo.writeMicroseconds(1100);
  11. Serial.begin(9600); // initialize serial communication at 9600 bits per second:
  12. }
  13.  
  14. void loop() {
  15.  
  16. buttonS = digitalRead(button);
  17.  
  18. if (buttonS == 1) {
  19. int signal = 1700;
  20. servo.writeMicroseconds(signal);
  21. }
  22. else (buttonS == 0); {
  23. servo.writeMicroseconds(10);
  24. }
  25. Serial.println(buttonS);
  26. delay(1);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement