properly sets mux

This commit is contained in:
Brendan Haines 2020-03-02 13:57:55 -07:00
parent 3e31202987
commit 9316389b71

View File

@ -15,7 +15,7 @@ if __name__ == "__main__":
mux_io[2] = digitalio.DigitalInOut(board.D22)
mux_io[3] = digitalio.DigitalInOut(board.D23)
for ii, io in mux_io:
for ii, io in enumerate(mux_io):
io.switch_to_output()
i2c = busio.I2C(board.SCL, board.SDA)
@ -27,7 +27,7 @@ if __name__ == "__main__":
global mux_io
global adc_mux
mux = 1-np.array(list(f"{chan:04b}"), dtype=int)
for ii, io in mux_io:
for ii, io in enumerate(mux_io):
io.value = mux[ii]
return adc_mux.voltage