sonyhome / FAB_LED

Fast Arduino Bitbang LED library supports programmable LEDs (WS2812B, APA102...), color palettes for Arduino AVR
GNU General Public License v2.0
126 stars 16 forks source link

Need program for stair led project. #37

Closed a619sachin closed 3 years ago

a619sachin commented 3 years ago

I need example for using two PIR motion sesors and WS2812B led (600 pixels in total). I tried Adafruit library and I was unable to go beyond 548 leds using Arduino Uno. One member in Arduino forum mentioned about this library but I cannot find sufficient example for my setup to work.

ednieuw commented 3 years ago

Use the €15 Arduino nano Every. It has more memory.

ednieuw commented 3 years ago

The nano every has 48kb memory. I use it with 625 Sk6812 leds. It is also cheap and can be bought as a original Arduino product at their website

On 8 Sep 2021, at 10:56, a619sachin @.***> wrote:

 @ednieuw I think they both have EEPROM/SRAM [kb] 1/2 and Flash Memory 32kb, right!!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

a619sachin commented 3 years ago

@ednieuw I get this message after compiling the code Sketch uses 4578 bytes (14%) of program storage space. Maximum is 32256 bytes. Global variables use 230 bytes (11%) of dynamic memory, leaving 1818 bytes for local variables. Maximum is 2048 bytes. Do you think there is memory problem?

ednieuw commented 3 years ago

You can check it by reducing the amount of leds to lets day 10 leds. If the compiler reports the same amount of free memory you know it is not reporting the memory that is allocated for the leds. With the adafruit library this was the case with my program. In my case I used 100 leds and the program size was 23000 bytes. With more leds the program went havoc. You can also try another ws2812 library like

https://github.com/cpldcpu/light_ws2812

On 8 Sep 2021, at 17:31, a619sachin @.***> wrote:

 @ednieuw I get this message after compiling the code Sketch uses 4578 bytes (14%) of program storage space. Maximum is 32256 bytes. Global variables use 230 bytes (11%) of dynamic memory, leaving 1818 bytes for local variables. Maximum is 2048 bytes. Do you think there is memory problem?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

a619sachin commented 3 years ago

I commented all the debug helping line. It worked

sonyhome commented 3 years ago

Thank you for closing this request.

For info: Each LED uses about 3 bytes of memory for storage of the display array, like Adafruit's unless you go into the other modes (color palette or on the fly computation of the LED colors, depending on the pattern complexity). This library is more memory savvy than Adafruit's but it will only get you so far.

When a program runs it also needs a stack to call and return from functions, which may overrun your free memory and is not accounted for. The only way to know if it fits in a small memory footprint is to try it out.