Advertisement
krot

arduino кнопка

Jul 5th, 2016
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #define led 13
  2. #define pin12 12
  3.  
  4. // the setup routine runs once when you press reset:
  5. void setup() {
  6.   // initialize the digital pin as an output.
  7.   pinMode(led, OUTPUT);
  8.   pinMode(pin12,INPUT);
  9. // Serial.begin(9600);
  10. }
  11. // the loop routine runs over and over again forever:
  12. void loop() {
  13.   int value=digitalRead(pin12);
  14.   digitalWrite(led, value);
  15.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement