analog_read() for Wristband GPIOs
Continuing off from #31 (closed), we could add support for analog_read()
from the wristband GPIOs using the ADC peripheral (ref lib/sdk/Documentation/html/group__adc.html
).
Continuing off from #31 (closed), we could add support for analog_read()
from the wristband GPIOs using the ADC peripheral (ref lib/sdk/Documentation/html/group__adc.html
).
added 1-Additional-Feature 3-Module labels
I've been thinking about this today while touching gpio.c... Should this live under the same API? API-wise it might be intuitive to:
gpio.set_mode(gpio.WRISTBAND_1, gpio.mode.INPUT | gpio.mode.ANALOG)
gpio.read(gpio.WRISTBAND_1)
but I'm still unsure about this. Symmetry-wise, I like this. My first thought was that this might be problematic regarding the return value type of epic_gpio_read but actually it totally makes sense to keep the "genative return for error" paradigm there, as well since positive-only values do make sense for ADC input, we'd just have to define and document a scaling for the integer values then.
Coming back to symmetry, some might then expect
gpio.set_mode(gpio.WRISTBAND_1, gpio.mode.INPUT | gpio.mode.ANALOG)
to work as well, but they'll either be greeted with -EPARM then. Or they'll be greeted by an epic PWM signal on their wristband
mentioned in merge request !229 (merged)
closed via merge request !229 (merged)