krot

arduino кнопка

Jul 5th, 2016
73
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  }
RAW Paste Data