S
S
Sergei Alekhin2016-09-20 01:38:38
Arduino
Sergei Alekhin, 2016-09-20 01:38:38

How to link adafruit_neopixel and VirtualWire libraries in arduino?

I ran into a problem with the interaction of the library for the WS2812 tape and the rf transmitter at 433 Mhz. It turned out that adafruit_neopixel disables any interrupts while sending data to the tape, as a result, the RF receiver simply cannot send anything to the arduino.
As soon as I add a line pixels.show (); to display the WS2812 tape, the receiving part of the program is closed tightly. Apparently because quite frequent updates of the tape are coming.
I ask for help to set up the interaction of a colored LED strip and an rf transmitter. Alternatively, by connecting two arduins to a bridge. Which protocol is better to choose so that it uses the minimum interruption?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Ocelot, 2016-09-20
@Ocelot

Retrain VirtualWire to use Timer2? Please note that Timer2 is 8-bit, it may not be enough. In theory, you need to replace all registers related to the timer in the vw_setup() function, replace the SIGNAL(TIMER1_COMPA_vect) interrupt handler and fix the _timer_calc() function, because different timers have different prescaler values.
You can also look for another library for WS2812. This one doesn't seem to use timers at all, just assembly magic:
https://github.com/cpldcpu/light_ws2812

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question