Hi to All
Ws2811 is a RGB Led.
It means that the LED can light up red, green or blue. Compinations can also be made.
Controlled with only one pin from the ESP32. Each LED also has an input and output so that many LEDs can be connected in series.
Flowcode supports this very comfortably with one component.
Unfortunately, for some reason the LED component cannot be initialised in the macro but only in the main.
However, the comands for the colour and brightness can be easily used in macros
regards
Stefan
Testet 100times....
ESP32 and WS2811: init in macro not working
-
- Valued Contributor
- Posts: 760
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 150 times
- Been thanked: 171 times
-
- Matrix Staff
- Posts: 1263
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 168 times
- Been thanked: 279 times
Re: ESP32 and WS2811: init in macro not working
Perhaps there needs to be a delay or some other code happening before the Initialise() macro is called.
What is within your Init() macro? And does it matter if the Initialise() is at the start or end of that macro?
What is within your Init() macro? And does it matter if the Initialise() is at the start or end of that macro?
-
- Valued Contributor
- Posts: 760
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 150 times
- Been thanked: 171 times
Re: ESP32 and WS2811: init in macro not working
I have tested with delay before and after many times.
But it only helped to put the component init into the main.
Even if I switch from main to macro without or with a delay, it only works if the component init, is in the main part.
It is not a big problem, the LED works perfectly after that.
But it only helped to put the component init into the main.
Even if I switch from main to macro without or with a delay, it only works if the component init, is in the main part.
It is not a big problem, the LED works perfectly after that.
-
- Valued Contributor
- Posts: 1162
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 287 times
- Been thanked: 415 times
Re: ESP32 and WS2811: init in macro not working
Hi
Does it fail to compile if in the Macro or does it just not work (initialise)?
Using a PIC it compiles in either.
Regards
Does it fail to compile if in the Macro or does it just not work (initialise)?
Using a PIC it compiles in either.
Regards
-
- Valued Contributor
- Posts: 760
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 150 times
- Been thanked: 171 times
Re: ESP32 and WS2811: init in macro not working
Hi Lain
It's compile always, just the led is not working.
What also happened a few times was that the LED lit up at full power in white.
At the moment it seems to be working and I realise when it's not.
I'm not sure if it has to do with the ESP-IDF 5.12
In my project, the LED has many functions.
1. red flash, warning , if no sd-card is inserted
2. green switched on, Ok reayd for recording
3. red, when recording is running
4. blue flash if Bluetooth command is receiving.
It's compile always, just the led is not working.
What also happened a few times was that the LED lit up at full power in white.
At the moment it seems to be working and I realise when it's not.
I'm not sure if it has to do with the ESP-IDF 5.12
In my project, the LED has many functions.
1. red flash, warning , if no sd-card is inserted
2. green switched on, Ok reayd for recording
3. red, when recording is running
4. blue flash if Bluetooth command is receiving.
-
- Matrix Staff
- Posts: 1263
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 168 times
- Been thanked: 279 times
Re: ESP32 and WS2811: init in macro not working
Also, what if the Initialise() is in Main but comes before the Init() macro? Does it work ok then?
-
- Valued Contributor
- Posts: 760
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 150 times
- Been thanked: 171 times
Re: ESP32 and WS2811: init in macro not working
Yes !
- Attachments
-
- Snag_d34861.png (33.73 KiB) Viewed 1257 times
-
- Snag_d33248.png (32.09 KiB) Viewed 1257 times
-
- Snag_d3121e.png (31.55 KiB) Viewed 1257 times
-
- Valued Contributor
- Posts: 760
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 150 times
- Been thanked: 171 times
Re: ESP32 and WS2811: init in macro not working
it's not the first time I had problems with the led but it was working again, without knowing why
https://flowcode.co.uk/forums/viewtopic.php?f=5&t=2315
https://flowcode.co.uk/forums/viewtopic.php?f=5&t=2315
-
- Valued Contributor
- Posts: 760
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 150 times
- Been thanked: 171 times
Re: ESP32 and WS2811: init in macro not working
Hi Steve
A problem again with the ESP32 (upgrade?) and WS2811.
on an another board with an ESP32 pico, before the led was working nice. now the led color can just change before init Bluetooth.
After the init Bluetooth, if I set the led to blue, the led is just dark.
If i remove the command to set blue the led is correct green.
This was working nice before....
I use the led mainly to indicate
blue, the bluetooth is working,
green, the recorder is ready for recording
red, recording in progress
Flashing, no SD card inserted
for me it is important that the led works correctly
A problem again with the ESP32 (upgrade?) and WS2811.
on an another board with an ESP32 pico, before the led was working nice. now the led color can just change before init Bluetooth.
After the init Bluetooth, if I set the led to blue, the led is just dark.
If i remove the command to set blue the led is correct green.
This was working nice before....
I use the led mainly to indicate
blue, the bluetooth is working,
green, the recorder is ready for recording
red, recording in progress
Flashing, no SD card inserted
for me it is important that the led works correctly
- Attachments
-
- Snag_1528cf.png (26.69 KiB) Viewed 447 times
-
- Matrix Staff
- Posts: 1263
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 168 times
- Been thanked: 279 times
Re: ESP32 and WS2811: init in macro not working
Sorry, Stefan. I don't use that LED component. I will ask here and see if anyone else has any idea to solve your problem.