Advertisement
jmyean

Testing LED

May 17th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  // Declare Constants and variables
  3. const byte Button=8;
  4. const byte Button2=9;
  5. const byte Button3=10;
  6. const byte Button4=11;
  7. byte ReadVal; // variable to read button
  8. //const byte LedPin2 = 19
  9.  
  10. void setup() {
  11.   pinMode(Button, INPUT);
  12.   pinMode(Button2, INPUT);
  13.   pinMode(Button3, INPUT);
  14.   pinMode(Button4, INPUT);
  15.   Serial.begin(9600);
  16. }
  17. void loop() {
  18.   ReadVal = digitalRead(Button4); //when on the ReadVal should be 1 and off should be 0, otherwise it is not being read
  19.   Serial.println(ReadVal);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement