Closed
Description
The DAC object allows passing to write a value that's greater than the DAC supports, like 1024, 9999, etc. We should catch this and fail with an out of bounds error. Example:
import machine
dac = machine.DAC()
dac.write(9999)
Interestingly a write of 9999 outputs a voltage around 2.5v when the reference is 3.3v. Values within the 10-bit range (0-1023) have the expected out and are all good, so this is a minor issue.