mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
16 lines
232 B
Python
16 lines
232 B
Python
import PikaStdLib
|
|
import PikaStdDevice
|
|
|
|
time = PikaStdDevice.Time()
|
|
adc1 = PikaStdDevice.ADC()
|
|
|
|
adc1.setPin('PA1')
|
|
adc1.enable()
|
|
|
|
while True:
|
|
val = adc1.read()
|
|
print('adc1 value:')
|
|
print(val)
|
|
time.sleep_ms(500)
|
|
|