Touch panels
A touch panel is a capacitive touch screen on an I2C bus. Its settings are set once, in a config node, and a gui screen or a touch node picks it.
On a gui screen, pick the panel in the screen's properties. The screen reads it itself and turns touches into button presses. There is no wire to draw. If the panel stops answering, the screen's status dot says so, and any button being held is let go without sending.
Settings
- controller — the touch chip. Supported hardware lists the chips covered (the FT6336U, as on the Freenove ESP32-S3 displays).
- I2C bus — the bus the panel is wired to. See I2C bus. On the Freenove 4.0" board: SDA 16, SCL 15.
- address — the chip's I2C address. 0x38 for the FT6336U.
- reset pin — the panel's reset pin, if it has one (Freenove: 18). Blank for none.
- poll every (ms) — how often to look. 20 is smooth; more than 50 starts to feel slow.
- panel width / height — the panel's own size in pixels (Freenove: 320 × 480).
- swap x and y / flip x / flip y — turn the panel's coordinates into the display's. If the display is rotated, tick these until a touch lands where you pressed.
Presets
The touch panel's edit form has a preset control, like the display nodes. Fill in the settings once, press the
disk button, and give the set a name (for example freenove-4in). In another flow, open a new touch panel and pick
that name to fill the form. The I2C bus is not saved, since it belongs to the flow; pick or add it after loading.
Rotated screens
If the display the gui screen is wired to has an orientation, the screen's touch axes are turned to match the picture. The raw touch node is not turned.
Other touch chips
For a chip this node doesn't cover, such as GT911 or CST820, read it from a function node with
runtime.shared('i2c', 0), using the chip's datasheet and a MicroPython driver for it. See
docs.micropython.org for the I2C calls.