Hi folks, Im kinda new here…I need some help with code for anArduino Pro Mini and ADXL337 accelerometer and a LED strip of 60 leds. I have never used interupts before and want to know if there is a better way to do this…If I must use interupts can someone kindly show me the form the code should take? The problem is updating the accelerometer values while runnng a pattern on the LED strip…I want it to change colors as I stop and go on my scooter…Any ideas or help would sure be appriciated!!
If you’re using WS2811/WS2812 Neopixel LEDs on an AVR-based Arduino (like the Pro Mini), you can’t use interrupts at the same time.
So one of these things has to change:
- switch to a different microcontroller board (e.g. Teensy3.1)
- switch to different LEDs (e.g. APA102’s), or
- restructure the code to not use interrupts.
It’s just an unfortunate fact about the Neopixel LEDs and the AVR boards.
There is IR receiving library that uses interrupts and works nice with FastLED3.1 (up to ~20 LEDs).
You can look how it is written.
http://www.tuline.com/dru/content/arduino-fastled-and-irremote-reliability
Ah yes. For very small numbers of LEDs it can sometimes work. True.
Thanks for the advice!!! Unfortunatly Ihave already soldered in the Mini Pro so I will have to change the LEDS to APA102’s. I have never used those before. I understand that the 102’s can still use the same librarys like FastLED and Neopixel. Is this correct?? As fae as code goes, I have no idea how to go about solving the update issues if I can not use interupts…Is that possible to do? I want my accelerometer to change the color of LEDs in almost real time. At least that is the goal. Thanks SO much again for the help. 