During the UNTZtrument test, I was able to press a button that lit the LED and then press it again to turn it off. That code looks something like this:
Code: Select all
if (MODE == LATCHING) {
// If a button was just pressed or released...
if (trellis.readSwitches()) {
// go through every button
for (uint8_t i=0; i<numKeys; i++) {
// if it was pressed...
if (trellis.justPressed(i)) {
Serial.print("v"); Serial.println(i);
// Alternate the LED
if (trellis.isLED(i))
trellis.clrLED(i);
else
trellis.setLED(i);
}
}
// tell the trellis to set the LEDs we requested
trellis.writeDisplay();
}
}
}
Could I add this to the UNTZtrument_Hello_World code in order to make this work?