Docs menu

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 pinRoleBehavior
GPIO2Button 1Active-low input with internal pull-up
GPIO3LED 1Active-high output; initially LOW/OFF
GPIO4Button 2Active-low input with internal pull-up
GPIO5LED 2Active-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

PathResult
Button 1 → Indicator 1PASS — physically proven
Button 2 → Indicator 2PASS — physically proven
LED1 touchscreen switch → GPIO3 / physical LED1PASS — approximately 0 V OFF / 3.3 V ON
LED2 touchscreen switch → GPIO5 / physical LED2PASS — 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.

Detailed evidence records