Wish NeoPixels Library

Robert Gately

Member
Licensed User
I tested your latest code but I'm receiving this error: 'b4r_ws2812b' has not been declared.

It looks great. I'm glad that it is possible to do with a small amount of code.

I was wondering if the C code could automatically multiply by 3, so that all the user has to do is supply the numberOfLEDs.

Thanks for your great work!
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
I was wondering if the C code could automatically multiply by 3, so that all the user has to do is supply the numberOfLEDs.

I spent a few hours on that... According to EREL, it's not that easy, thus no other solution for time being than to manually change the value in the C code.

For the error, have you called WS2812B.initialise(...) in your main code?
 

Robert Gately

Member
Licensed User
I spent a few hours on that... According to EREL, it's not that easy, thus no other solution for time being than to manually change the value in the C code.

For the error, have you called WS2812B.initialise(...) in your main code?

No, there was no text in my code called "WS2812B.initialise(...)". So I added: "WS2812B.initialise(3)" to the AppStart sub, but B4R reports that it is an undeclared variable.

Previously, I added this line: "Initialize(3)" to the the AppStart sub, but saw the error: "b4r_ws2812b has not been declared".

I simply copied your two examples and pasted them into B4R and changed the number of LEDs and the multiplication factor. The first example worked, but the second example caused the error. The second example did not include an AppStart sub, so I thought it might be missing something, so I created the AppStart sub and put "Initialize(3)" in it.

I'm not in a hurray. Thank you.
 

Cableguy

Expert
Licensed User
Longtime User
The code posted in this thread has been converted into a code module.
Search for the WS2812B Code Module thread in the Libraries sub Forum, In the IDE, under Project, create a new Code Module and name it WS2812B if you like, then copy all of the code in that thread into the newly created Module.
 
Last edited:

Robert Gately

Member
Licensed User
Thank you for directing me. The module works wonderfully! I'm so happy that Erel came out with B4R, I'm falling in love with programming again.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…