# GPIO Exercises ## Exercise A: Blinky 1. Find the blinky example in the [esp-hal GPIO documentation](https://docs.rs/esp-hal/latest/esp32c3/esp_hal/gpio/struct.Output.html) 2. Identify the **Instantiate**, **Configure**, and **Control** steps 3. Adapt the pin to match the uFerris LED pin (check your pinout card) 4. Flash and verify — the LED should blink --- ## Exercise B: Button Input 1. Find the **Input** abstraction in the esp-hal GPIO documentation 2. Configure it with **pull-up** (since the hardware button pulls to ground) 3. Find the method that detects when the button is pressed (low) 4. Modify your blinky to turn on the LED when the button is pressed --- ## Exercise C: Alternative Blink 1. Look into the **Output** documentation in esp-hal 2. Find a different way to achieve the same blink behavior, without using the same approach as in Exercise A 3. Modify your code to blink the LED using this alternative approach --- ## Cross-HAL Comparison How do other HALs handle GPIO? Navigate the documentation for these two libraries and find how they approach the same tasks: - [rp2040-hal](https://docs.rs/rp2040-hal/latest/rp2040_hal/) - [stm32f4xx-hal](https://docs.rs/stm32f4xx-hal/latest/stm32f4xx_hal/) Compare how each HAL handles **Instantiate**, **Configure**, and **Control** for GPIO.
The Embedded Rustacean · Rust Week 2026