-
Notifications
You must be signed in to change notification settings - Fork 0
Performance
Let’s call the time taken to output the frame for 1 light T. So the time taken by the Arduino outputting the frames for all 24 lights on a string is 24T. But the Arduino only sends to the first light in the string. A light will forward frames not addressed to it. So the time a frame takes to get to its destination depends on how many lights it must be forwarded through. A light forwarding a frame takes T to do this. For Example if the frame is destined for the 8th light the total time in transit is 8T.
The Arduino outputs the frame addressed to the 24th light in the string. To the Arduino the job of sending frame data is complete in time T, but each light on the G35 string also needs time T to forward a frame. So the actual time for a frame to reach and show on the designated light is ID*T. For the 24th light in the string this is 24T. If the Arduino were to output the frames from left to right this means that after 24T outputting frames the last light still has 23T longer before receiving the updated frame. This would bring the transmit time to 47T.
The solution to reducing the time frames spend reaching their destination light is thus. Send the frame with the farthest distance in T to travel first. Supporting this using the current Set_Pixel functions required changing the order of the light IDs. This was accomplished by creating an Enumerate function that set a Mask with the desired ID order as 1, 2, … 24 and sends this out to all the strings. The Prepare_Masks function was modified to put the IDs in the Masks as 24, 23, …1. A change was made in Set_Pixel to subtract the desired ID from 24. Thus reversing the effective order of the lights. Send_Picture still goes through the Masks index from 0 to 359, but the IDs output in the frames now start with the right most light and work leftward.