Skip to content

Realtime Responsiveness Explained

Xiangmin Xu edited this page Apr 17, 2022 · 4 revisions

This program is designed to be a realtime system. So here we are analyzing the ablibity of real time response of it.

The Sensor

The sensor works at two sampling rates, 8Hz or 2Hz (Mode 0b100 or Mode 0b010), and for every picture frame it outputs, the sensor needs two samples, every single sample is called a subpage. If it works under 8Hz sampling rate, it has a framerate of 4Hz, so the time for us to process the data should be around 250 ms.

Qt and hasValue() Callback

As is measured, the data process in hasValue() function, together with the Qt QPainter event, takes no longer than 2 ms, so there is enough time for every frame of data to be handled as 250 ms is far more the 2 ms, which we need.

The Light Bulb Control

The light bulb control functions are based on cURL libs as the bulb is remote and is connected wirelessly. HTTPS function tends to have a lot of waiting latency, which sometimes can be as long as half a second, so in our project, the hue communication function is multi-threaded designed, and properly joined, so there is no latency in light control.

Clone this wiki locally