I picked up Arduino again after probably a year. Fun to be back, but I'm getting some weird symptoms now that I cannot explain which makes me think I damaged my board, although a friends board does the same.
I was trying to do a LED on with momentary push button (push button, LED on - stays on, push button, LED off - stays off). I couldn't figure out the code so I went looking for some code to learn. Found some, wrote my own version, LED stays on when I load the sketch. Push button, nothing changes - some flickers when I push the button. Removed button, LED on again - then off. Noticed I could just touch the wire going to the pinButton (reading state of the pin - pin goes HIGH button is pressed).
Then started to worry the board might be damaged. Loaded the blink sketch. Works fine. Changed the pin to output to say pin 10, wired up an LED. Plug board into USB (for power) - works fine, LED blinks. Tried the same with the FADE sketch - works perfect.
Then loaded the sketch called "Button" in the example menu under Digital. Wired up (three times in a row) board - loaded sketch - LED stays on. Remove the 5V wire going to the switch - LED stays on. Checked the code -else statement puts ledPin to LOW.
Wired up a pull-up and a pull-down switch to check - same result. Tried a different input pin, same result. Seems as soon as I use digitalWrite on any pin, it starts acting weird.
I'm using IDE 1.0 - am I missing something which I should know that changed from 0.18 to 1.0? Running Windows 7 Pro 64bit. Loaded the driver according to installation file. Its a seeeduino V2.21 board (ATmega328)
Could I have somehow (due to ignorance after a year absence) have fried just enough of my board to have it act this way? And then I suppose I friend my friends' board as well to have the same symptoms - well it had the same symptoms with the one sketch I ran which I copied from a member's post that does exactly what I wanted to try and accomplish - using a momentary switch, turn on an LED when I press and let go of the switch, and turn off the LED when I press and let go of the switch again.
I'm stumped. Could very high humidity have anything to do with the current state of things? It rained (BTW I am working in the house, not in the rain ) and the last few days we have been having high humidity levels.
Thanks for the good or not so good news.
EDIT: Whilst making this post I had the board disconnected from the USB (from my Linux laptop just to check if it was Windows but same issue). I inserted the USB on the board. Hooked up the LED one wire at a time - the LED is off. Hooked up only the wires for the switch but. LED is OFF. Touched the wires to act as a switch - LED ON. Cool. Touched wires again - LED OFF. Cool. Touched wires again - LED ON. Cool. Again - now LED stays on no matter how many time I touch the wires. I left it connected with the LED on whilst posting the "EDIT" of this post, turned around just now and the LED was OFF. Tried to put the switch in the breadboard to see if it'll switch on the LED and the LED came on by itself. Could this be humidity? I don't want to plant the seed of cause by saying that, but my thinking is if you fry your board its pretty much fried and useless, not perfectly useless in some cases and perfectly working in others.
EDIT2: I also notice that I seem to be one massive ball of static even though I am sitting barefoot on sandstone. If I have a wire plugged into pin 7 (reading pin 7 as input) and I just close my fingers around the wire without even touching it, I can make the onboard (pin 13) LED go ON and OFF. Maybe I'm like the Incredible Hulks' dad, or was it brother where he turned into lightning or electricity or something.