SHARE
TWEET

Untitled

a guest Mar 26th, 2020 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. int readVal;
  3. const int led = pinNo;
  4. const int button = pinNo;
  5.  
  6. void setup() {
  7.   // put your setup code here, to run once:
  8.  
  9. Serial.begin(9600);
  10. pinMode(led, OUTPUT);
  11. pinMode(button, INPUT);
  12.  
  13. }
  14.  
  15. void loop() {
  16.   // put your main code here, to run repeatedly:
  17.  
  18. readVal= digitalRead(button);
  19. Serial.println(readVal);
  20.  
  21. if (readVal == 1) //rememner double == and && in if statements.
  22.   {
  23.     digitalWrite(led, HIGH);
  24.   }
  25.   digitalWrite(led, LOW);
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top