-
-
Save Bhavithiran97/2377f28915a1e310dfe1f3d68d32173c to your computer and use it in GitHub Desktop.
read line sensor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import machine | |
import utime | |
line = machine.ADC(26) # set pin 26 as analog INPUT | |
def read_line_sensor: # read line sensor function | |
return line.read_u16() | |
while True: | |
print(read_line_sensor()) # print line sensor value | |
utime.sleep(1) # sleep 1 second |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment