MrYsLab / NeoPixelConnect

A PIO based WS2812 NeoPixel library for the Arduino Nano RP2040 Connect, and Raspberry Pi Pico
GNU Affero General Public License v3.0
27 stars 5 forks source link

pio0 used by software serial? #6

Closed eried closed 7 months ago

eried commented 7 months ago

Hi, im trying to quickly understand why opening a softwareserial makes this stop working, is there is an easy way to not use any pio? i.e. just bitbang in the "main" thread?

MrYsLab commented 7 months ago

Hi Erwin, Thanks for the question. Bitbanging control of NeoPixels is highly complex in that the timing must be exact down to the microsecond level. Here is an article that describes the process for an Uno R3. It is also very processor-intense and may only allow little more than driving the NeoPixels to occur.

The NeoPixelConnect library allows one to select either pio0 or pio1 and to select a state matching to use in the PIO. Here is a pointer to the constructor that allows you to specify this. Both of the examples provided use this constructor.

Please let me know if this answers your question, and if it does, please close the issue. Also, feel free to ask any other questions you may have.

eried commented 7 months ago

Hey thanks for the article, I will check it out