Monitoring a switch, in Toit
The purpose of this trivial sample is to better understand how to write power efficient code in Toit. Warning, as is, it is not power efficient. For a device to be able to operate without a battery change for a year, requires careful consideration of the power consumption of sensors, peripherals, power supply, processor and radio used. Modern processors, with a multitude of subsystems, have various sleep states with some combination of features and power....