Hi MCU experts. I am quite new in the Arduino and PlatformIO universe, and I am faced with a strange issue. I am trying to address a WS2812B LED strip on an Arduino Uno R3 using the FastLED library. There is no problem when I use the ArduinoIDE, but I get no light at all when I use the PlatformIO with Visual Studio Code.
Experimental setup:
tested with Arduino Uno R3 (original) and Arduino Nano v3 (clone)
VSC v1.63.2 (Win10)
PlatformIO v2.4.0 (Core 5.2.4 Home 3.4.0)
FastLED v3.5.0 (checked with some older versions as well)
example: FirstLight.ino with following changes #define NUM_LEDS 2 #define DATA_PIN 6 FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
I checked the output with a logic analyzer. When I compiled with ArduinoIDE I get the expected result (#000000#ffffff delay #ffffff#000000 etc). The timing of one triple byte (#000000) is 30µs.
Same sample compiled with PlatformIO results in no light. But with logic analyzer I see #000000#000000 delay #000000#000000 etc. The timing is a little bit different: 46µs for a triple byte (#000000). All bits are well-formed zero bits.
Where is my mistake? Or is this a bug? I can’t believe that I’m the first one using PlatformIO for Arduino with FastLED library. Thanks in advance.
Before I open a Github issue, I would like to be sure that this is a reproducible bug. From my current perspective it seems to be a problem with WS281x LED strips using the FastLED library on atmelavr platform. And this is a quite common setup.
Therefore, I am not sure if I have found a real bug or if it is just an incorrect operation/configuration from my side (as mentioned I’m new to PlatformIO and VSC). Maybe someone with this hardware could try to reproduce this issue and give me feedback. Thanks.
If you have the same hardware and sketch working in the Arduino but not PlatformIO and they are both supposed to use the same core version, you have sufficient grounds to assume a bug and thus an issue can be opened.