Code: Select all
byte lastValue1 = HIGH;
byte lastValue2 = HIGH;
// the setup routine runs once when you press reset:
void setup() {
pinMode(BTN_PIN1, INPUT_PULLUP);
pinMode(BTN_PIN2, INPUT_PULLUP);
}
// the loop routine runs over and over again forever:
void loop() {
byte currentValue1 = digitalRead(BTN_PIN1);
byte currentValue2 = digitalRead(BTN_PIN2);
// Button Down
if (currentValue1 != lastValue1) { // if state changes
lastValue1 = currentValue1; // save new state
if (lastValue1 == LOW) {
zunoSendToGroupSetValueCommand(CONTROL_GROUP, SWITCH_OFF); // if button pressed - send switch OFF command
}
If so can the line of code be written as !HIGH ?