16 lines
214 B
Python
Raw Normal View History

2021-10-04 10:04:06 +08:00
import PikaStdLib
import machine
2021-10-04 10:04:06 +08:00
time = machine.Time()
adc1 = machine.ADC()
2021-10-04 10:04:06 +08:00
adc1.setPin('PA1')
adc1.enable()
while True:
val = adc1.read()
print('adc1 value:')
print(val)
2021-10-04 10:59:18 +08:00
time.sleep_ms(500)