measuring bike speed while updating LED over SPI

Status
Not open for further replies.

tmorrowus

Member
I'm looking to measure the frequency of a reed switch attached to my bicycle wheel with a Teensy 3.1 to calculate bicycle speed. The code needs to be nonblocking so that I can be updating about 700 APA102 LEDs with most of the processor cycles.

I found the FreqMeasure library, but that looks to be blocking. I was looking for something interrupt driven where it could count the pulses even if they happened during the SPI updates to the LEDs.

I'm not very up on my interrupt programming so I'd prefer a library that covers that over for me, but if I have to do the interrupt programming I haven't been able to find interrupt examples for Teensy 3.1 Teensyduino so I'd appreciate a pointer to that.

Thanks!
 
Status
Not open for further replies.
Back
Top