mirror of
https://github.com/brendanhaines/ECEN5458_Project.git
synced 2025-01-30 11:37:39 -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
|
||||
|
||||
if __name__ == "__main__":
|
||||
mux = np.empty(4)
|
||||
mux[0] = digitalio.DigitalInOut(board.D17).value
|
||||
mux[1] = digitalio.DigitalInOut(board.D27).value
|
||||
mux[2] = digitalio.DigitalInOut(board.D22).value
|
||||
mux[3] = digitalio.DigitalInOut(board.D23).value
|
||||
mux_io = np.empty(4, dtype=object)
|
||||
mux_io[0] = digitalio.DigitalInOut(board.D17)
|
||||
mux_io[1] = digitalio.DigitalInOut(board.D27)
|
||||
mux_io[2] = digitalio.DigitalInOut(board.D22)
|
||||
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)
|
||||
adc = ADS.ADS1015(i2c)
|
||||
|
|
Loading…
Reference in New Issue
Block a user