MicroPython-Examples/Example - ADC Reading/main_ReadADC.py

11 lines
199 B
Python
Raw Normal View History

2024-05-10 13:26:38 +02:00
from machine import ADC
import time
# Assign ADC Pin 0 to Sensor
sensor = ADC(0)
# Repeatedly Read u16 value and print
while True:
result = sensor.read_u16()
print(result)
time.sleep(1)