This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Interrupt when ACI data event available

Hi, I have an nRF8001 on a Red Bear Lab BLE shield mounted on an Arduino Uno. I'm using BLE to trigger the execution of potentially long running (well, a few seconds anyway) sequences of LED light patterns in, for example, nested for loops in my Arduino sketch.

I'd like to be able to respond immediately to new BLE data events, even when an LED sequence is running, so I can immediately change the pattern. As things stand, the for loops block retrieval of ACI events from my ACI event loop and I was hoping I could somehow use interrupts. For example maybe I can have an interrupt signalled when a BLE data event is available and in my interrupt handler I can then set a variable which means "exit current operation" so that control can return to my ACI event loop.

Is this possible and if so how should I approach this?

Thank you

Related