2021-11-21 16:32:30 +08:00

17 lines
226 B
Python

import PikaStdLib
import STM32G0
time = STM32G0.Time()
adc1 = STM32G0.ADC()
adc1.init()
adc1.setPin('PA1')
adc1.enable()
while True:
val = adc1.read()
print('adc1 value:')
print(val)
time.sleep_ms(500)