Skip to content

Digital output on A0 with DAC enabled doesn't work or fail #4

@tdicola

Description

@tdicola

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions