Skip to main content
Prompts ESP32 C++17 UI Library Developer

developer coding user risk: low

ESP32 C++17 UI Library Developer

Act as an Embedded Systems Developer to implement a generic UI library for ESP32 using PlatformIO, Arduino-ESP32, ESPAsyncWebServer, LittleFS, ArduinoJson v7, and UI-Schema. Includ…

PROMPT

Act as an Embedded Systems Developer. You are an expert in developing libraries for microcontrollers with a focus on the ESP32 platform.

Your task is to develop a UI library for the ESP32 with the following specifications:

- **MCU**: ESP32
- **Build System**: PlatformIO
- **Framework**: Arduino-ESP32
- **Language Standard**: C++17 (modern, RAII-style)
- **Web Server**: ESPAsyncWebServer
- **Filesystem**: LittleFS
- **JSON**: ArduinoJson v7
- **Frontend Schema Engine**: UI-Schema

You will:
- Implement a Task-Based Runtime environment within the library.
- Ensure the initialization flow is handled strictly within the library.
- Conform to a mandatory REST API contract.
- Integrate a C++ UI DSL as a key feature.
- Develop a compile-time debug system.

Rules:
- The library should be completely generic, allowing users to define items and their names in their main code.

This task requires a detailed understanding of both hardware interface and software architecture principles.

OPTIONAL CONTEXT

  • user-defined UI items

ROLES & RULES

Role assignments

  • Act as an Embedded Systems Developer.
  • You are an expert in developing libraries for microcontrollers with a focus on the ESP32 platform.
  1. Implement a Task-Based Runtime environment within the library.
  2. Ensure the initialization flow is handled strictly within the library.
  3. Conform to a mandatory REST API contract.
  4. Integrate a C++ UI DSL as a key feature.
  5. Develop a compile-time debug system.
  6. The library should be completely generic, allowing users to define items and their names in their main code.

EXPECTED OUTPUT

Format
markdown
Constraints
  • C++17 RAII-style
  • complete library implementation
  • include initialization flow
  • conform to REST API
  • integrate C++ UI DSL
  • compile-time debug system

SUCCESS CRITERIA

  • Develop a UI library for ESP32 using specified MCU, build system, framework, language standard, web server, filesystem, JSON library, and frontend schema engine.
  • Implement required features including Task-Based Runtime, initialization handling, REST API conformance, C++ UI DSL, and compile-time debug system.
  • Ensure library is completely generic.

FAILURE MODES

  • May invent unspecified details for mandatory REST API contract.
  • May lack details on UI-Schema integration leading to incorrect implementation.
  • May produce non-RAII C++17 code.
  • May not fully handle PlatformIO and Arduino-ESP32 specifics.

CAVEATS

Missing context
  • Details on UI library functionality (e.g., supported UI elements, web UI features).
  • Exact REST API specification (endpoints, methods, payloads).
  • Examples of user code using the library.
  • Hardware assumptions (e.g., display type if any).
Ambiguities
  • 'Frontend Schema Engine: UI-Schema' is undefined or unexplained.
  • 'Mandatory REST API contract' lacks specific endpoints or structure.
  • 'C++ UI DSL' is mentioned but not detailed.
  • 'Task-Based Runtime environment' lacks precise definition.
  • 'Compile-time debug system' is vague on implementation.

QUALITY

OVERALL
0.65
CLARITY
0.80
SPECIFICITY
0.70
REUSABILITY
0.30
COMPLETENESS
0.60

IMPROVEMENT SUGGESTIONS

  • Define or provide documentation link for 'UI-Schema'.
  • Specify the exact REST API contract with endpoints and examples.
  • Include syntax examples for the C++ UI DSL.
  • Clarify 'Task-Based Runtime' with architecture diagram or pseudocode.
  • Add success criteria like example main.cpp using the library.

USAGE

Copy the prompt above and paste it into your AI of choice — Claude, ChatGPT, Gemini, or anywhere else you're working. Replace any placeholder sections with your own context, then ask for the output.

MORE FOR DEVELOPER