Difference between revisions of "UBISS2024exam"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
<syntaxhighlight lang="python" line='line'>import time | <syntaxhighlight lang="python" line='line'>import time | ||
− | from machine import Pin | + | from machine import Pin, ADC |
− | + | from time import sleep | |
− | while | + | |
− | + | y = ADC(Pin(26)) | |
− | + | ||
− | + | while True: | |
− | + | z = y.read_u16() | |
+ | print(z) | ||
+ | sleep(1) | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 11:57, 13 June 2024
1 import time
2 from machine import Pin, ADC
3 from time import sleep
4
5 y = ADC(Pin(26))
6
7 while True:
8 z = y.read_u16()
9 print(z)
10 sleep(1)