Close

Even better frame timing

A project log for FREKVENS FJÄRRKONTROLL

A hacked IKEA FREKVENS LED cube with an Onion Omega inside, running JavaScript to render lights

ates-goralAtes Goral 05/20/2020 at 04:530 Comments

Significantly improved frame timing with a simple tweak to prevent timing errors for individual frames to accumulate over time.

Created a binary clock (to avoid the hassle of rendering actual digits). It's all 6-bit values from top to bottom: hours, minutes, seconds. The rapidly moving dot at the bottom is a frame counter: 12 x 5 = 60 frames per second. The clock doesn't read the current time of the OS constantly. Instead, it calculates what the time should be based on the rendered frames. If there's any timing issues with rendering or if frames are dropped, it should cause the clock to lag behind.

Showing reference time on my laptop with a big clock I wrote as a dweet and there's a 1-second difference despite both the Omega and my laptop being synched with NTP. I'll keep this running until the morning and see how much of a deviance there'll be.

Discussions