B4R Question AAX - Studio

Hi,
Can anyone tell me the best way to integrate AAX projects into B4R?
There are a few tutorials for the Arduino IDE, but I'm not quite sure how to go about it with B4R.
I'd appreciate any advice.
 
Thanks for sharing this info about EEZ Studio—very interesting!

I explored how to use it with B4R, starting with a simple "Hello World" test with two labels (lbl_hello and lbl_title) to see what EEZ Studio generates and how best to integrate it into a B4R project.

EDIT 20261129: to avoid confusion have removed the content as outdated > replaced by the B4R Library rEEZStudio.
 
Last edited:
Upvote 0
Update 20261127 (see post #1)
Touch input, generic button click events, and live slider value updates are now working on the ESP32 CYD (ESP32-2432S028)!

EDIT 20261129: information outdated. See B4R Library rEEZStudio.

What's New in v0.25
  • Dynamic Resolution: eez.Initialize("EEZ_Click", 320, 240) allocates the LVGL draw buffer dynamically.
    (Tip: In EEZ Studio, make sure to select Pages > Main and set its individual Geometry Width = 320, Height = 240 so the layout matches the CYD 1:1.)
  • Touchscreen Input Bridge: eez.SetTouch(x, y) feeds resistive touch coordinates from rLovyanGFXEx into LVGL 9's pointer input driver.
  • Generic Event Bridges (No Custom C Callbacks Needed per Widget):
    • RegisterClick(Obj, Tag) forwards LV_EVENT_CLICKED directly to B4R's Sub EEZ_Click(Tag As Int).
    • RegisterValueChanged("EEZ_ValueChanged", Obj, Tag) forwards LV_EVENT_VALUE_CHANGED directly to B4R's Sub EEZ_ValueChanged(Tag As Int, Value As Int).
  • Generic Widget Helpers: SetLabelText, SetLabelColor, SetPos, SetVisible, SetSliderValue, and GetSliderValue.

Updated B4R Example (Label + Button + Slider)
In this test, dragging the EEZ Studio slider (sld_test) updates the label text/color and adjusts the CYD backlight brightness in real time, while tapping the button (btn_test) sets the slider back to 50.

1795790005681.png


B4X: Copy
'==============================================
' Project:        rEEZStudio
' Brief:        Example with Button & Slider
' Description:    Render an EEZ Studio (LVGL 9) UI on an ESP32 CYD using rLovyanGFXEx, handle button clicks and slider value changes in B4R.
' Author:         Robert W.B. Linn (c) 2026 MIT — see LICENSE file.
' Date:         20261127
' DependsOn:    rLovyanGFXEx, rEEZStudio
' Hardware:        ESP32-CYD-SUNTON, B4R 4.10 (64 bit), IDE ESP32 Dev Module, Arduino Board Manager ESP32 3.3.12.
' Wiring:        No additional wiring
'==============================================

#Region Project Attributes
    #AutoFlushLogs: True
    #CheckArrayBounds: True
    #StackBufferSize: 4096
    #DefineExtra: #define ESP32_2432S028
#End Region

'Ctrl+Click to open the C code folder: ide://run?File=%WINDIR%\System32\cmd.exe&args=/c&args=explorer.exe&Args=%PROJECT%\Objects\Src

Sub Process_Globals
    Public Serial1 As Serial
    Private eez As EEZStudio
    Private lcd As LovyanGFXEx
    Private lblTitle As ULong
    Private btnTest As ULong
    Private sldTest As ULong
    Private ClickCount As Int = 0
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Log("[AppStart] Starting rEEZStudio v0.25...")
 
    ' 1. Initialize CYD display driver FIRST
    lcd.Initialize("LCD_TOUCHED")
    lcd.DisplayRotation = 3
    lcd.Brightness = 255
 
    ' 2. Initialize LVGL + EEZ Studio UI
    eez.Initialize("EEZ_Click", 320, 240)
    AddLooper("LoopEEZ")
 
    ' 3. Map EEZ Studio C object pointers to B4R ULong variables once
    RunNative("MapObjects", Null)
    Log("[AppStart] lblTitle=", lblTitle, ", btnTest=", btnTest, ", sldTest=", sldTest)
 
    ' 4. Register interactive widgets with numeric Tags
    eez.RegisterClick(btnTest, 1)
    eez.RegisterValueChanged("EEZ_ValueChanged", sldTest, 10)
 
    ' 5. Set initial slider value and label text
    eez.SetSliderValue(sldTest, 50, False)
    eez.SetLabelText(lblTitle, "Slider: 50".GetBytes)
    eez.SetLabelColor(lblTitle, 0x0055FF)
    eez.SetPos(lblTitle, 40, 20)
End Sub

' Looper updating LVGL timers and EEZ Studio UI state
Private Sub LoopEEZ
    eez.Tick
End Sub

' Forward resistive touch coordinates from rLovyanGFXEx into LVGL 9
Private Sub LCD_TOUCHED(x As ULong, y As ULong)
    Log("[LCD_TOUCHED] x=", x, ", y=", y)
    eez.SetTouch(x, y)
End Sub

' Generic click event triggered by rEEZStudio for any registered widget
Private Sub EEZ_Click(Tag As Int)
    Log("[EEZ_Click] Tag=", Tag)
    Select Tag
        Case 1
            ClickCount = ClickCount + 1
            Log("[EEZ_Click] Resetting slider to 50 (Click #", ClickCount, ")")
            eez.SetSliderValue(sldTest, 50, True)
            eez.SetLabelText(lblTitle, "Slider: 50 (Reset)".GetBytes)
            eez.SetLabelColor(lblTitle, 0x008800)
    End Select
End Sub

' Generic value-changed event triggered when dragging a slider
Private Sub EEZ_ValueChanged(Tag As Int, Value As Int)
    Log("[EEZ_ValueChanged] Tag=", Tag, ", Value=", Value)
    Select Tag
        Case 10
            eez.SetLabelText(lblTitle, JoinStrings(Array As String("Slider: ", NumberFormat(Value, 0, 0))).GetBytes)
            eez.SetLabelColor(lblTitle, 0xCC0066)
            ' Adjust CYD backlight brightness (15..255) directly from the slider
            lcd.Brightness = Max(15, (Value * 255) / 100)
    End Select
End Sub

' --- OBJECT POINTER MAPPING ---
#If C
void MapObjects(B4R::Object* o) {
    b4r_main::_lbltitle = (ULong)objects.lbl_title;
    b4r_main::_btntest  = (ULong)objects.btn_test;
    b4r_main::_sldtest  = (ULong)objects.sld_test;
}
#End If
 
Last edited:
Upvote 0
So, I guess this is a kind of "Nextion", only in B4R side?
 
Upvote 0
Yes, conceptually very similar!

EEZ Studio acts like the Nextion Editor for designing multi-page GUIs visually (drag & drop), except instead of needing a separate Nextion MCU, SD card flashing, and UART serial commands, LVGL 9 renders the UI directly on the ESP32 (driving a standard SPI TFT like the CYD via rLovyanGFXEx), and rEEZStudio bridges the widgets and events straight into B4R.

I am currently wrapping up testing on the core LVGL 9 controls (Labels, Buttons, Toggles, Sliders, Arcs, Bars, Round Scales, Dropdowns, Rollers, LEDs, Spinboxes, and multi-screen switching) and will publish rEEZStudio in the B4R Libraries forum soon!
 
Upvote 0
... currently wrapping up testing on the core LVGL 9 controls (Labels, Buttons, Toggles, Sliders, Arcs, Bars, Round Scales, Dropdowns, Rollers, LEDs, Spinboxes, and multi-screen switching) and will publish rEEZStudio in the B4R Libraries forum soon!

Published rEEZStudio v0.40.

Note: partially removed content of posts #4 and #5 as outdated > replaced by the B4R libraries forum post rEEZStudio.
 
Last edited:
Upvote 0
So, this allows for the same principle as Nextion Editor but with any lcd, right?
 
Upvote 0
Exactly! You get the same visual drag-and-drop workflow as Nextion Editor, but it works with any standard SPI/parallel LCD and touch controller supported by rLovyanGFXEx (LovyanGFX) - such as ILI9341, ST7789, ST7796, ILI9488, RGB panels, etc. - driven directly by the ESP32 with no proprietary Nextion display hardware or serial protocol needed.

My first impression of EEZ Studio is really good - once the project is set to LVGL 9.x and pointed at the rEEZStudio folder, designing multi-page layouts, styling widgets, and generating clean C/C++ code for B4R is fast and straightforward, which is what inspired me to develop rEEZStudio in the first place.
 
Upvote 0
the last question is, the big advantage of the nextion is that the UI does not "take space" in the esp ram... so, how heavy is this EEZ solution in RAM footprint
 
Upvote 0
Great point.
A Nextion offloads the UI memory to its own processor, whereas here the ESP32 holds the LVGL state in SRAM.

On a standard ESP32 (520 KB SRAM / ~320 KB usable heap), the footprint is still very manageable:
- Display Draw Buffer: 15 KB (320 × 24 × 2 bytes, 1/10th screen partial buffer)
- LVGL Object/Style Pool (LV_MEM_SIZE): 48–64 KB (each widget only uses ~40–80 bytes inside this pool, so even a 5-page UI easily fits)
- Fonts, Bitmaps & Static Texts: Stored in Flash (PROGMEM) via const arrays (lv_label_set_text_static), taking 0 bytes of SRAM

So in total it takes roughly 65–85 KB of SRAM, leaving 230+ KB of free heap on a standard ESP32 for Wi-Fi, MQTT, and B4R logic (and even more headroom if using an ESP32-S3 / WROVER with PSRAM = my fav).
 
Upvote 0
plus, considering one can add extra flash or even an sd breakout... nice to read... hope to test this soon
 
Upvote 0
Back
Top