Go Down

Topic: Button Help - Trying to make LED go off when button is not pushed (Read 806 times) 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?

Nick Gammon

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

More info:

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131