physical-computation / Warp-firmware

Firmware for the Cambridge Physical Computation Laboratory's Warp Embedded Multi-Sensor Platform.
http://physcomp.eng.cam.ac.uk
BSD 3-Clause "New" or "Revised" License
5 stars 198 forks source link

Provide option in the Warp menu to choose whether to sleep between measurement readings when reading all sensors indefinitely #128

Open janithpet opened 1 year ago

janithpet commented 1 year ago

Currently, option 'z' in the Warp menu will sleep between readings for the number of seconds given by the user.

Firstly, this number of seconds is asked in milliseconds, even though it is actually implemented in seconds.

Secondly, we can't sleep at the resolution of milliseconds, since the current implementation of the function accepts the time to sleep in seconds.

The simplest solution is to provide an option to the user asking whether they want to sleep during the delay. If they choose yes, then ask for the delay in seconds. If not, ask for the delay in seconds, and do a busy loop for that time.