Go Down

Topic: Strobe (Read 3 times) previous topic - next topic

Grumpy_Mike

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.

ematson5897

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


Grumpy_Mike

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: [Select]
   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?

ematson5897

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?

Grumpy_Mike

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.

Go Up