forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
This might be by design and isn't necessarily expected to be supported, but I noticed if I enable the DAC (which uses A0 as the output) I can still create a digital output for pin A0, like:
import machine
# Enable DAC and output 0V
dac = machine.DAC()
dac.write(0)
# Now make a digital out for A0 and set it high
led = machine.Pin("A0", machine.Pin.OUT)
led.high()
After running the above the A0 pin is still at 0V. This seems expected since only one thing can control that pin at a time, however it might be nice to fail in some way so the user knows they are doing something wrong. Perhaps if you try to use pin A0 as a digital output with the DAC enabled we catch that state and fail with an error.
Not a huge priority issue.