Having put some code together and surprisingly got it working, there's acouple of things that I'm still confused about;
When I say 'working', the last unplanned thing that is happening is the code skips merrily past my test of a button being pressed;
buttonPin ==HIGH,
edited from buttonPin =HIGH,
and climbs back to the "VOID loop () { " like a homesick angel. I'm expecting it to wait until I press the button, then move on throught the do-something-interesting-loop.
{
snipped out some other loops
{
if (buttonPin ==HIGH)
{
Serial.println(buttonPin);
//do something interesting
Serial.println("something interesting was done");
}
}
}
While trying to figure out what was going on with this, I used;
Serial.println(buttonPin)
...to see what is happening with the button, I was expecting to see either HIGH or LOW, even 0 or 1 perhaps...
but what I'm seeing is;
7
(7 is the pin the button is connected to via either pull up or pull down resistor, I've tried both)
I've also run a bare bones button sketch and the same thing happens, also happens on a different pin if you look at an led pin
Serial.println(ledpin)
Is the displaying of the pin number just symbolic of HIGH or is there a way of getting a more meaningfull answer to help in hunting down the reason for the homesick angel bug?
thanks.