BaseExample

Example of the component fdivitto/fabgl v2.0.0
# Composite BaseExample

Color **composite video (PAL / NTSC)** test screen, generated by the ESP32 internal DAC with no external
components.

The screen shows a small GUI to choose the video standard, plus an RGB color bar test and a circle to check the
aspect ratio. The selected settings are saved in NVS and restored at the next boot.

## What it demonstrates

- `fabgl::CVBS16Controller`: 16-color composite video output on GPIO25
- Interlaced and progressive PAL-B and NTSC-M modes, including wide and extended variants
- Monochrome output and horizontal rate multiplier (`setHorizontalRate()`)
- The FabGL GUI (`uiApp`, combo box, check box, button) on a composite display
- `fabgl::Preferences` (NVS) to store settings

## Hardware

- Composite video output on **GPIO25** (connect to the yellow RCA input of a TV; a 5 MHz low-pass filter may
  improve the picture)
- PS/2 keyboard on port 0 and PS/2 mouse on port 1, to operate the GUI

## Usage

Use the mouse (or the keyboard: `Tab` moves the focus, `Space`/`Enter` activates) to change:

| Control | Meaning |
|---|---|
| **Mode** | Video standard: Interlaced/Progressive PAL-B, NTSC-M, their *Wide* variants and Progressive NTSC-M *Ext* (default: Progressive PAL-B) |
| **B/W** | Monochrome output (applied immediately) |
| **H. Rate** | Horizontal rate multiplier x1, x2, x3 (higher values give more horizontal pixels; default x2) |
| **Apply** | Saves the settings. If Mode or H. Rate changed, the board restarts to apply them |

The bottom of the screen shows free memory and the current resolution.

If a mode does not sync on your TV, erase the NVS partition (`idf.py erase-flash`) to go back to the defaults.

## Build

See [Building the examples](../../../README.md#building-the-examples) in the main README.

> Note: this example has not been tested on hardware with FabGL2 yet.

To create a project from this example, run:

idf.py create-project-from-example "fdivitto/fabgl=2.0.0:BaseExample"

or download archive (~5.30 KB)