GPIO Exercises
~50 min
Exercise A: Blinky
- Find the blinky example in the esp-hal GPIO documentation
- Identify the Instantiate, Configure, and Control steps
- Adapt the pin to match the uFerris LED pin (check your pinout card)
- Flash and verify — the LED should blink
Exercise B: Button Input
- Find the Input abstraction in the esp-hal GPIO documentation
- Configure it with pull-up (since the hardware button pulls to ground)
- Find the method that detects when the button is pressed (low)
- Modify your blinky to turn on the LED when the button is pressed
Exercise C: Alternative Blink
- Look into the Output documentation in esp-hal
- Find a different way to achieve the same blink behavior, without using the same approach as in Exercise A
- 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:
Compare how each HAL handles Instantiate, Configure, and Control for GPIO.