lua-scripts icon indicating copy to clipboard operation
lua-scripts copied to clipboard

Hardware extension widget (LVGL Lua dev contest)

Open wimalopaan opened this issue 10 months ago • 0 comments

This PR is a submission to the lvgl LUA script dev contest.

It shows the use of most of the new lvgl UI controls available with EdgeTx 2.11.

What is the purpose of this widget?

This widget is called the hardware extension widget. Its purpose is to read and visualize the state of external controls like pots, switches, buttons, incrementals, ... . This is done via one of the serial connections of the radio (AUX1, AUX2) reading messages of the hardware extension protocol: https://github.com/wimalopaan/Electronics?tab=readme-ov-file#hwext.

By this means it can read external controls, like upto 16 11-bit (proportional) values as well as 64 binary switch values.

Ideally the firmware for the radio has PR https://github.com/EdgeTX/edgetx/pull/5885, so that this widget can set the virtual controls according to the external controls.

Main telemetry screen (this widget is upper left): tele01

Visualizing the external controls: if a virtual switch is configured as an external button, it is shown as a blue square, if this button is on it turn to a _red_square. if a virtual input is configured as an external input, it is shown as a filled rectangle, the height of the filling resembles the value of the external control (pot). main01 main02

The settings:

settings01 settings07 settings02 settings06 settings03 settings05 settings04

Example: TX16s extended by 32 3-pos switches (64 binary switches), two 4D Sticks (6 proportional inputs and two switches) and two space-mouse (6 values each) via an external µC unit. The stick-end switches (5 switches) are controlled by an internal (not visible) µC unit. Both can work together.

IMG_20250322_164859_124 (1)

wimalopaan avatar Apr 01 '25 12:04 wimalopaan