测试DAC,ADC
1、测试代码
(1)MicroPython程序
from machine import DAC,ADC
import utime
adc0 = ADC(0, init=True)
dac0 = DAC(0)
vdim = []
outdim = list(range(0, 0xfff, 10))
print("Test DAC,ADC...")
for o in outdim:
dac0.write_u16(o)
utime.sleep_ms(2)
vdim.append(adc0.read_u16())
print(vdim)
|