'''
button_led.py
toggle between two LEDs via button press
'''
from machine import Pin
from time import sleep_ms
button = Pin(12, Pin.IN, Pin.PULL_UP)
led1 = Pin(27, Pin.OUT)
led2 = Pin(33, Pin.OUT)
while True:
if not button.value():
print("LED1 IS ON, LED2 IS OFF")
led1.v...
'''
button.py
'''
from machine import Pin
from time import sleep_msx...
There are two different ways to wire up a basic LED circuit to ESP32 3V
and GND
GND
to a blue bus on the side of your breadboard3V
to a red bus on the side of your breadboard220R
(or similar) to run the 3...
We will use Thonny to interact with our ESP32 from our computer
Windows11 | MacOS |
---|---|
![]() |
![]() |