Pages: [1]   Go Down
Author Topic: Button Help - Trying to make LED go off when button is not pushed  (Read 336 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 86
Posts: 3459
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code?
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
Full Member
***
Karma: 2
Posts: 148
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

maybe something like this?
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Wiring? Read this:

http://www.gammon.com.au/switches
Logged

Pages: [1]   Go Up
Jump to: