TEXT 209
S9 ABBASI Guest on 14th October 2023 08:47:38 AM
  1. #define led 13
  2. #define but  7
  3.  
  4. void setup()
  5. {
  6.   pinMode(led,OUTPUT);
  7.   pinMode(but,INPUT);
  8. }
  9.  
  10. void loop()
  11. {
  12.   int i = digitalRead(but);
  13.  
  14.   if(i == HIGH)
  15.   {
  16.     digitalWrite(led,HIGH);
  17.   }
  18.   else
  19.   {
  20.     digitalWrite(led,LOW);//Turn the LED on
  21.   }
  22. }

Hightechrobo bin is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.