mjmeli / MSP430-NeoPixel-WS2812-Library

An easy to use library for controlling WS2812 LEDs (branded by Adafruit as NeoPixels) with an MSP430 microcontroller.
40 stars 16 forks source link

[Solved] How can i optimize showStrip() function ? #5

Open iotproductions opened 6 years ago

iotproductions commented 6 years ago

Hi there,

First of all, thank you for shared this library, it work fine with MSP430G2553. I'm using this library in oder to control 126 LEDs. But, i got some issues with the memory of MSP430G2553, this MCU only have 512 byte RAM. So, if i use this library for 126 LEDs, (NUM_LEDS = 126) it will take 126*3 = 378/512 bytes for leds array. I'm looking for another way to save RAM spaces. Can you please suggest for me some sulotions ? Thanks you so much !

niwhsa9 commented 6 years ago

Leetrieu, the RAM limit is the RAM limit plain and simple. Unless I'm mistaken, I don't think you can reduce the store of 126 full RGB (3 byte) colors for each light. However, you do have a couple options: A) Do a repeating RGB pattern across the strip B) Allow individual color picking but only in a limited range. E.G. currently each bulb takes 3 bytes, make each bulb require 1 or 2 and then have those values map to RGB of your choice C) Drive the strip at one solid color D) Obtain a more powerful chip

iotproductions commented 6 years ago

@niwhsa9 Thank for your information so much ! I'm shipping a led strip for testing the code. I also reduced color bytes for a bulb by using 2 bytes(5 bit for a color) instead for 3 bytes, it help me save 126 bytes on RAM. And one more question, i use 126 LEDs in order to make 6 seven-segment LED (21 LED for a seven-segment led, HH::MM:SS ), So is there an effective solution for show numberic on 6 seven-segment led? My target is like this video: https://www.youtube.com/watch?v=LojGHyBFE8Q

niwhsa9 commented 6 years ago

Leetrieu, I'm not entirely sure if I understand your quesiton. Could you rephrase?

iotproductions commented 6 years ago

Hi @niwhsa9 , I just received my LED strip. And my issues has been solved, thank you so much !