On 02/06/10 21:38, James Bensley wrote:
As another test I used some digital inputs, when I press the left button "A IS ON" is displayed on the LCD, when I press the right button "B IS ON" is display, even though you can't make out the text, you can see in this video that just being near the button makes the Arduino sense enough voltage to indicate the button is pressed and display some text...
It's not 100% clear from the video but it looks like you haven't done what I said with the inputs and used a pull up or pull down resistor.
http://www.arduino.cc/en/Tutorial/Button
It's not that your Arduino is faulty, this is common to pretty much everything. If you just have a switch between supply and an input then when the switch is open the input is floating. Then EMI, crosstalk, leakage, RF, damp, solar flares or just a bloody great walking antenna putting their hands near it....pretty much anything can make it float just enough to go high.
http://www.youtube.com/watch?v=jKuIDsq0WIQ
OMGWTFBBQ?
I have forgotten how I wired that pot but I ripped it all apart and started over with this small test but the problem still persists?
and How did you wire it this time ? as a voltage divider ? I probably need to see a drawing of what you have done.
Is it wired like this http://arduino.cc/en/Tutorial/AnalogInput
Also a general question, I am unfamiliar with Arduino's but is it just common that switch inputs are debounced in the code rather than in hardware ? I'm used to PIC's were we don't always have enough resources to waste on debounce code so it is frequently done in hardware and in this case we wouldn't use that top example from the arduino site. You'd do something more like the example in fig 2A here.