I want to control 50 rgb-led-boards that are daisy-chained via serial board. Each Board is equipped with 50 rgb led's and a microcontoller, and all led's do the same for each board, so i can just dim / colorchange each board individually, but not single led's.
The guys that did the electronics for that came up with a protocol, where i have to send individual messages to the ledboards via serial port:
-> first *, second adress of the ledboard (in this case 01, means first board), third Red-Value (in this case 10), fourth Green-Value (in this case 20), fifth Blue-value (in this case 30) and last $ to complete the command.
Attached is my patch how i achieve this message format via sprintf & regexp.
My first question is:
While it is working fine, i guess there are more elegant ways / objects to achieve the same translation.
I have to send the messages one after another, so if i would like to dim the Red channel of the led board Nr.1 I have to send a series of messages ala:
I guess if I want to control/dim 50 led-boards at the same time, the speed of the serial connection cannot handle it, heh? (right now i can only try with two boards, while the other 48 will be finished only a few days before I have to use them).
Does anybody know how many messages can be send in one second and maybe give some tips also how i could avoid in such a setup that messages got lost in the transfer? somehoe i have the feeling that there will be a lot of problems with the 50 daisychained boards, and that i cannot really control all of them simultanously...
thanks for hints