Home โ€บ Module 1
โšก Module 01 ยท Intermediate

MicroPython on ESP32

Ready to put actual Python code onto a tiny $5 chip that can talk to the internet?... โœจ PAN'S RULE: If it's not chaotic, it's not magic! โœจ

Ditch the visual blocks. Write real Python code to control microcontrollers over Wi-Fi.

โš ๏ธ SAFETY DIRECTIVE: We only work with safe 5V USB power or AA/AAA batteries. NEVER plug homemade electronics into a wall outlet or mess with mains electricity. Keep the magic safely low-voltage!
๐Ÿ’ป

Coding the Hardware

Instead of using complex C++, you can control advanced microcontrollers (like the ESP32) using MicroPythonโ€”a version of Python built specifically for tiny hardware chips.

๐Ÿ“บ DroneBot Workshop โ€” "ESP32 Introduction" โ€” Why the ESP32 is the ultimate board for IoT projects.

๐Ÿ”ฎ Deep Dive: Ghost in the Shell

A robot without code is just an expensive paperweight. When you write a PID loop or a motor control script, you are breathing life into the machine. You have to handle "sensor noise"โ€”because the real world is messy! Light sensors get confused by shadows, ultrasonic sensors bounce off weird angles. Your code has to be paranoid, constantly checking its surroundings and adjusting its math so it doesn't drive itself directly off a cliff.

๐Ÿ•ต๏ธ Knowledge Check

Why do robots use a PID loop instead of just turning motors on and off?

To smoothly adjust speed as it gets closer to a target, preventing it from overshooting and crashing.
Because PID loops use less electricity.
๐Ÿ’ป Mission: The Hardware LED Loop

Blinking an LED with MicroPython

Send a digital high (1) or low (0) voltage to Pin 2 on the board to turn the built-in LED on and off in an infinite while loop.

๐Ÿ”— Learn More

Want to dive deeper into this topic? Check out these external resources:

โ† Previous