Go Down

Topic: Button Help - Trying to make LED go off when button is not pushed (Read 1 time) previous topic - next topic


Hello world,
    I am trying to apply the button tutorial to a rock band guitar. The idea is that when I push a button on the guitar, the light goes on. Instead, when I push the guitar button, the light goes off (and is just on always). I have tried playing with the program but the light still stays on. I am connecting the ground and digital power 2 to the guitar wires.
    Am I missing something really simple here? I am a total novice at this thing and could really use the help! Thanks in advance for any advice!!


My GitHub:


Code: [Select]

val = digitalRead(12);   // read the input pin
digitalWrite(13, val);

maybe something like this?


Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Go Up