Go Down

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

Boffin1



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
With my mobile phone I can call people and talk to them -  how smart can you get ?

Grumpy_Mike

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

Boffin1

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 :-)
With my mobile phone I can call people and talk to them -  how smart can you get ?

Go Up