Go Down

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

Tori_Nara

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!!
~T

HazardsMind

My GitHub:
https://github.com/AndrewMascolo?tab=repositories

grendle

Code: [Select]

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


maybe something like this?

Nick Gammon

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

Go Up