Arduino digitalWrite 1 or 0 instead of HIGH or LOW
Yes, that is fine.  LOW is 0 and HIGH is 1.  digitalWrite() sets the output to off if it receives a 0 and on if it receives anything of 1 or more.

That means that these are all equivalent:

digitalWrite(pin, HIGH);
digitalWrite(pin, 1);
digitalWrite(pin, 69);


It's especially useful when you are examining a variable for, say, a certain bit being set:

digitalWrite(pin, bytevar &amp; 0x80);


That will set the pin to high on any value from 128 to 255 in the byte variable, and low for anything below 128.