A pcf8591 driver for micropython
pip install micropython-pcf8591==0.1.1
It's actually very simple. Just import upip and install the package.
import upip
upip.install('micropython-pcf8591')
The PCF8591 class has 4 main public methods available: set_out, set_program, read, write.
Initializes the instance
True
, False
). Defaults to True
.AINPRG0
, AINPRG1
, AINPRG2
, AINPRG3
). Defaults to AINPRG0
.Sets the output flag
True
, False
).Sets the input program
AINPRG0
, AINPRG1
, AINPRG2
, AINPRG3
).Reads analog data from the device. When auto incrementing is enabled, this function will return all four inputs as a list, otherwise returns a single integer.
ACHNNL0
, ACHNNL1
, ACHNNL2
, ACHNNL3
, None
). Defaults to None
.Writes analog data to the device. It'll automatically enable analog out.
0-255
)As you can guess, there are no tests whatsoever, no coverage, nothing! You can create a distribution package by running this command inside pcf8591 directory.
python setup.py sdist optimize_upip