AaronLiddiment / RGBLEDS

Matrix, Text & Sprite libraries for use with FastLED
68 stars 28 forks source link

Hex values? Cleaner configuration options? A few critiques. #5

Closed webdevbrian closed 9 years ago

webdevbrian commented 9 years ago

Hi,

Thanks for the library, few questions and critiques :

I think if this was cleaned up a bit this would be a hell of a library, in it's current state, it's almost impossible to use this on anything less than an arduino mega due to the shear size of the settings you need to define for each bit of text. I can get past the size of the libraries, but the settings for defining text, maintainability, really puts me off about this lib.

Thanks

AaronLiddiment commented 9 years ago

Hi, There is nothing stopping you declaring #defines using RGB for the colours:

define PURPLE EFFECT_RGB "\xff\x00\xff"

define YELLOW EFFECT_RGB "\xff\xff\x00"

const unsigned char TxtDemo[] = { PURPLE "This is Purple text" YELLOW "and this is Yellow text" };

The method I have used for specifying the wide range of options is the most memory efficient method. Do you realise that each \xNN is converted by the compiler into a single byte! There are readable #defines for all the options with only the parameters needing to be specified as numbers!

Your text array declaration is not limited to a single line! See the examples provided with the library. Also note that if you have followed the examples and declared the array as 'const unsigned char' outside of any function that it will be placed in ROM taking up program space and not in the more limited RAM space. If you require text messages with changing elements then there are various ways of doing this efficiently but without seeing your specific code I cannot advise you.

I cannot understand why you are having to setup text in 3 separate places, I can only assume your programming knowledge is limited and as for "sheer size of the settings" I am puzzled! Please post/send me a copy of your code so that I can advise you better.

Regards Aaron