Hardware Examples
Hardware Example 01 — 2 Buttons + 2 LEDs
The first fully physically proven ForgeUI Hardware Example on the Waveshare ESP32-P4-WIFI6-Touch-LCD-7B.
PHYSICALLY PROVEN ON ESP32-P4
| Board pin | Role | Behavior |
|---|---|---|
| GPIO2 | Button 1 | Active-low input with internal pull-up |
| GPIO3 | LED 1 | Active-high output; initially LOW/OFF |
| GPIO4 | Button 2 | Active-low input with internal pull-up |
| GPIO5 | LED 2 | Active-high output; initially LOW/OFF |
Generated contracts and developer ownership
c
/* Generated Runtime SDK: called by developer-owned GPIO input code */
void FG_Set_Indicator1(bool on);
void FG_Set_Indicator2(bool on);
/* Genuine generated UserEvents: implemented by developer-owned code */
void FG_On_LED1_Toggle_Changed(bool checked);
void FG_On_LED2_Toggle_Changed(bool checked);ForgeUI owns the editable UI, generated LVGL, Runtime SDK and genuine UserEvent contract. Developer-owned 96_Hardware_Example_01.c configures GPIO and debounces inputs; preserved developer-owned UserEvent bodies delegate output changes to that module. No hardware integration reaches into private generated LVGL objects.
Accepted physical results
| Path | Result |
|---|---|
| Button 1 → Indicator 1 | PASS — physically proven |
| Button 2 → Indicator 2 | PASS — physically proven |
| LED1 touchscreen switch → GPIO3 / physical LED1 | PASS — approximately 0 V OFF / 3.3 V ON |
| LED2 touchscreen switch → GPIO5 / physical LED2 | PASS — approximately 0 V OFF / 3.3 V ON |
Troubleshooting local LED modules
Some LED test modules include a local enable, slider or interlock. Before blaming firmware, confirm that local hardware enable is ON and measure the GPIO directly. Expect approximately 0 V when OFF and 3.3 V when ON.
