17 lines
226 B
Python
Raw Normal View History

2021-10-04 10:04:06 +08:00
import PikaStdLib
2021-11-21 16:32:30 +08:00
import STM32G0
2021-10-04 10:04:06 +08:00
2021-11-21 16:32:30 +08:00
time = STM32G0.Time()
adc1 = STM32G0.ADC()
2021-10-04 10:04:06 +08:00
adc1.init()
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)