Lesson
1. Welcome (≈1 min)
Welcome back! Last class we met the microcontroller. Today, we make it do something. In programming, the first thing you ever write is called "Hello World". In electronics, our Hello World is making an LED blink. It sounds small, but once you can blink an LED, you've proven the whole chain works: software installed, board connected, code uploaded, hardware responding. Everything else in this course builds on that.

Here's the plan: install, connect, select, write, verify, upload, and watch.
2. Install the Arduino IDE (≈5 min)
The IDE, or Integrated Development Environment, is the app where we write code and send it to the board. It's free.
3. Install the board package (≈4 min)
Out of the box, the IDE doesn't know about every board, so we add support for ours.
4. Connect and select (≈4 min)
Now tell the IDE which board and which port:
- At the top of the IDE, click the Select Board dropdown.
- Choose the entry that says Arduino Nano ESP32, or click "Select other board and port", search "Nano ESP32", and pick the port it's on.
- Windows shows ports like COM3 or COM5.
- macOS shows something like /dev/cu.usbmodem….
- Linux shows /dev/ttyACM0.
Not seeing it? Nine times out of ten it's a charge-only cable. Swap cables first. Then try a different USB port, and avoid unpowered USB hubs.
5. Write the code (≈5 min)

Click File → New Sketch. A program in Arduino-land is called a sketch. You'll see two empty blocks already there, setup and loop. Delete what's there and type this in. We'd really encourage typing it rather than pasting; your fingers learn the shapes.
// Class 2 — Blink: the Hello World of electronics
// Board: Arduino Nano ESP32
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // set the built-in LED pin as an output (runs once)
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (pin goes to 3.3 V)
delay(1000); // wait 1000 milliseconds = 1 second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off (pin goes to 0 V)
delay(1000); // wait another second
}
Let's read it like English:
- Anything after two slashes is a comment: notes for humans. The board ignores them.
setup()runs once, when the board powers on or resets. We use it to get things ready.pinMode(LED_BUILTIN, OUTPUT)says "this pin will send power out".LED_BUILTINis a nickname for the pin the built-in LED is wired to, which is D13 on this board. The LED itself sits right next to the USB port.loop()runs over and over, forever.digitalWrite(..., HIGH)turns the pin on, which is 3.3 volts.LOWturns it off, zero volts.delay(1000)pauses for 1000 milliseconds, one second.
Two small details trip up everyone: every instruction ends with a semicolon, and capital letters matter. digitalwrite with a small "w" will not work.
6. Verify and upload (≈4 min)
- Click the tick (Verify). The IDE checks and compiles your code into something the chip understands. Look for "Done compiling" at the bottom. If you see orange error text, read the line number it mentions; it's almost always a missing semicolon or a typo.
- Click the arrow (Upload). This compiles again and sends it to the board. You'll see progress messages, then "Done uploading".
And… there it is. On for one second, off for one second. That's your first program running on real hardware. Take a moment, that's genuinely the hardest step of the whole course done!
Upload failed?
- Re-select the board and port from the dropdown.
- Double-tap the reset button quickly. The board enters bootloader mode (the RGB LED next to the USB port starts pulsing), then the port may change, so re-select it and upload again.
- Close any other program that might be using the port (e.g. another IDE window or 3D printer software).
7. Play with it (≈3 min)
This is the maker loop: change, upload, observe, repeat.
