Advertisement
DrAungWinHtut

button_input.ino

May 31st, 2022
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // C++ code
  2. // 2022-05-31
  3. void setup()
  4. {
  5.   pinMode(13, OUTPUT);
  6.   pinMode(7,INPUT);
  7.   Serial.begin(9600);
  8. }
  9.  
  10. void loop()
  11. {
  12.   int Input = digitalRead(7);
  13.   if(Input)
  14.   {
  15.     digitalWrite(13,HIGH);
  16.   }
  17.   else
  18.   {
  19.     digitalWrite(13,LOW);
  20.   }
  21.   Serial.println(Input);
  22.   delay(200);
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement