Skip to content

Commit

Permalink
adc example added
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-fryza committed Nov 28, 2024
1 parent 478c245 commit 514b9ed
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions examples/13-adc/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Complete project details at https://RandomNerdTutorials.com/micropython-programming-with-esp32-and-esp8266/

from machine import Pin
from machine import ADC
import time

sensor = ADC(Pin(36)) # A0/36 on FireBeetle v2 board
sensor.atten(ADC.ATTN_11DB) # Full range: 3.3V

while True:
value = sensor.read()
print(value)
time.sleep_ms(250)

0 comments on commit 514b9ed

Please sign in to comment.