Pages: 1 2 [3]   Go Down
Author Topic: Strobe  (Read 2757 times)
0 Members and 1 Guest are viewing this topic.
Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 631
Posts: 34478
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well don't send the data as ASCII numbers, just send byte pairs, so that is one less serial transfer per LED and you don't have to do multiplying.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 204
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How would I do that? And since the sketch won't permanently be serial based, couldnt I just find the ascii value of the input number for now? Evuntually it will use dmx

Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 631
Posts: 34478
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What exactly is the time you are trying to minimise?
You could skip the bit that spits all the values back to the serial port.

I am not sure what this is doing:-
Code:
   RedVal[i] = Value[i*5] * Value[i*5 + 3] / 255;
   GreenVal[i] = Value[(i*5) + 1] * Value[(i*5) + 3] / 255;
   BlueVal[i] = Value[(i*5) + 2] * Value[(i*5) + 3] / 255;
but a multiply and then a dived by 255 is time consuming. Why 255? I would have though 256 and then you can do it with a simple shift.
Have you remove the map() function, I spoke about before?
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 204
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Since the program also has a dimmer  that dims the whole rgb mix, that code has to be there. It calculates the values for rgb for the leds. If I used two atmega chips where one works with dmx and calculates those values and the other updates the leds, how much would the speed increase?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 631
Posts: 34478
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
If I used two atmega chips where one works with dmx and calculates those values and the other updates the leds, how much would the speed increase?
No idea,
Try it by removing those calculations and see the speed.
Logged

Pages: 1 2 [3]   Go Up
Jump to: