suoko

arduino pictoblox

Apr 25th, 2021
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. void setup()
  2. {
  3. pinMode(2, OUTPUT);
  4. pinMode(14, INPUT_PULLUP);
  5. pinMode(15, INPUT_PULLUP);
  6. }
  7. void loop()
  8. {
  9. if (digitalRead(14) == LOW)
  10. {
  11. digitalWrite(2, HIGH);
  12. }
  13. if (digitalRead(15) == LOW)
  14. {
  15. digitalWrite(2, LOW);
  16. }
  17. }
  18.  
  19. void setup() {
  20. pinMode(14, INPUT);
  21. pinMode(2, OUTPUT);
  22. pinMode(15, INPUT);
  23. }
  24. void loop() {
  25. if(digitalRead(14)) {
  26. digitalWrite(2, false);
  27. }
  28. if(digitalRead(15)) {
  29. digitalWrite(2, true);
  30. }
  31. }
  32.  
  33.  
  34.  
  35.  
  36.  
Advertisement
Add Comment
Please, Sign In to add comment