gpio_handler
module provides the main functionalities for reading input voltages from pins, setting output voltages along with some specific use cases for advanced operations.
import gpio_handler
gpio_handler.get_input_voltage(pin, voltage_divider, attn, measurement_cycles)
Get input voltage on a specific pin, for a given voltage divider and attenuator level.
_measurement_cycles_
in millivolt (float).gpio_handler.get_vin()
A simple wrapper to take Vin for pycom modules. Applicable only when using insigh.io board.
gpio_handler.set_pin_value(pin, value)
Set the Pin value to HIGH or LOW.
True
or 1
: HighFalse
or 0
: Lowgpio_handler.timed_pin_pull_up(pin, durationms)
Set Pin value to High for durationms time period and then set to Low.
gpio_handler.check_minimum_voltage_threshold()
If voltage is under 3 Volt, this can be used to terminate the process loop till the battery is adequately charged. Goes into deep sleep for 180 seconds. Applicable only when using insigh.io board.