I'm working on a project that will eventually use a parallax 5 state hatswitch button to control stuff on an iPhone/Android device but until my parallax switches arrive I'm using the RGB shield and just trying to get a sense for how things work...

I started with the ledButton sketch and set up pinWake on button1 or button2 to HIGH or LOW state, then go into ULPDelay until a pin wakes me up...

I must be doing something seriously wrong, because with my changes, pressing button 1 wakes the processor up constantly while it's pressed, and button 2 responds once and then neither button 1 or button2 have any effect...

do { // switch to lower power mode until a button edge wakes us up Serial.println("ULP Sleep"); RFduino_ULPDelay(INFINITE); } while (! debounce(state));

// if multiple buttons were configured, this is how you would determine what woke you up if (RFduino_pinWoke(button1)) { // execute code here Serial.println("reset button1"); RFduino_resetPinWake(button1); } else { Serial.println("reset button2"); RFduino_resetPinWake(button2); }}

void RFduinoBLE_onDisconnect(){ // don't leave the led on if they disconnect digitalWrite(led, LOW);}

void RFduinoBLE_onReceive(char *data, int len){ // if the first byte is 0x01 / on / true if (data[0]) digitalWrite(led, HIGH); else digitalWrite(led, LOW);}When I run it and watch what's going on in the serial monitor:

There's no repeating and releasing the button does nothing, the iPhone green button light stays on, neither button1 nor button2 have any effect, though clicking the iPhone app's "button" button does turn the LED on on the shield, so the sketch is still running...

I understand that completely. But RFduino_ULPDelay(INFINITE) puts things into an ultra-low power state and waits for input from the BLE or an input pin signal edge, (hence the RFduino_PinWake() calls) and, as I said, if I leave things using only one button things work as expected.