mirror of
https://github.com/brendanhaines/ECEN5458_Project.git
synced 2025-01-30 19:47:46 -07:00
WIP: restructure mux driver
This commit is contained in:
parent
772f8ddc9f
commit
a7ba379b0e
|
@ -9,11 +9,16 @@ import adafruit_ads1x15.ads1015 as ADS
|
||||||
from adafruit_ads1x15.analog_in import AnalogIn
|
from adafruit_ads1x15.analog_in import AnalogIn
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
mux = np.empty(4)
|
mux_io = np.empty(4, dtype=object)
|
||||||
mux[0] = digitalio.DigitalInOut(board.D17).value
|
mux_io[0] = digitalio.DigitalInOut(board.D17)
|
||||||
mux[1] = digitalio.DigitalInOut(board.D27).value
|
mux_io[1] = digitalio.DigitalInOut(board.D27)
|
||||||
mux[2] = digitalio.DigitalInOut(board.D22).value
|
mux_io[2] = digitalio.DigitalInOut(board.D22)
|
||||||
mux[3] = digitalio.DigitalInOut(board.D23).value
|
mux_io[3] = digitalio.DigitalInOut(board.D23)
|
||||||
|
|
||||||
|
mux_io = np.empty(4, dtype=object)
|
||||||
|
for ii, io in mux_io:
|
||||||
|
io.switch_to_output()
|
||||||
|
mux[ii] = io.value
|
||||||
|
|
||||||
i2c = busio.I2C(board.SCL, board.SDA)
|
i2c = busio.I2C(board.SCL, board.SDA)
|
||||||
adc = ADS.ADS1015(i2c)
|
adc = ADS.ADS1015(i2c)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user