Lesson Template
Digital I/O
Read pins and control LEDs using MicroPython Pin APIs.
Lesson Overview
This lesson introduces the core ideas behind Digital I/O.
- Pin.OUT
- Pin.IN
- value() read/write
Example Code
from machine import Pin
led = Pin(2, Pin.OUT)
led.value(1)