TiLDA MK4/sensors

From EMF Badge
Revision as of 18:03, 29 August 2018 by Mgsb (talk | contribs)
Jump to navigation Jump to search

Coming soon ... how to read the sensors supported in the tilda.Sensors module

Let's get started.

>>> from tilda import Sensors
>>> dir(Sensors)
['__class__', '__name__', 'BAT_ADAPTER_24', 'BAT_DONE_CHARGING', 'BAT_FAST_CHARGING', 'BAT_NOT_CHARGING', 'BAT_NO_INPUT', 'BAT_OTG', 'BAT_PRE_CHARGING', 'BAT_USB_HOST', '_raw_bq', 'get_charge_status', 'get_hdc_humidity', 'get_hdc_temperature', 'get_lux', 'get_tmp_temperature', 'get_vbus_connected', 'sample_rate']
>>> Sensors.get_charge_status()
0
>>> Sensors.get_charge_status()
2
>>> Sensors.BAT_FAST_CHARGING
2