Go Down

Topic: brain fart defining inputs (Read 595 times) previous topic - next topic


in one of the first examples "button" there is below..

Code: [Select]

int buttonState = 0;         // variable for reading the pushbutton status

 if (buttonState == HIGH) {    


Is there anything wrong with defining and setting it to LOW rather than 0 ?  
I know a 0 is logic LOW, but I cant remember why we use both here??
Probably need a coffee....... :o


Yes you can use LOW or false as well as 0.


Thanks Mike,
I think it might have been better in an early example to stick to either one or the other, I got confused and I am an old timer of 2 months :-)

Go Up