Skip to content

Compilation issue when using #define USE_ARDUINO_GFX_LIBRARY for nRF52840 #2

Closed
@qbalsdon

Description

@qbalsdon

I have:

  • Installed the Arduino IDE
  • Set up Arduino for the nRF2840
  • Added the LVGL, I2C BM8563 RTC and Arduino GFX libraries.
  • Manually installed the TFT_eSPI library from a ZIP file
  • Manually installed the Seeed Studio Round Display for XIAO library from a ZIP file
  • Copied the lv_conf.h file from the Seeed_Arduino_RoundDisplay library to the root Arduino library directory (/Users/{username}/Documents/Arduino/libraries/Seeed_Arduino_Round_display/lv_conf.h)

Since I am using a nRF52840, I did not configure the TFT_eSPI as I was informed by the tutorial I could skip this.

I then tried to compile the following code:

#include <lvgl.h>

// uncomment a library for display driver
// #define USE_TFT_ESPI_LIBRARY
#define USE_ARDUINO_GFX_LIBRARY

#include "lv_xiao_round_screen.h"
#include "lv_hardware_test.h"

void setup()
{
    Serial.begin( 115200 );  //prepare for possible serial debug 
    Serial.println( "XIAO round screen - LVGL_Arduino" );

    lv_init();

    lv_xiao_disp_init();
    lv_xiao_touch_init();

    lv_hardware_test();
}

void loop()
{
    lv_timer_handler();  //let the GUI do its work 
    delay( 5 );
}

And I get the following output:

In file included from /Users/{username}/{path_to_folder}/HardwareTest/HardwareTest.ino:8:
/Users/{username}/{path_to_folder}/HardwareTest/lv_hardware_test.h:67:42: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
   67 |     lv_label_set_text_fmt(battery_label, "%"LV_PRId32"%", battery_level_percent());
      |                                          ^
/Users/{username}/{path_to_folder}/HardwareTest/lv_hardware_test.h:73:41: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
   73 |     lv_label_set_text_fmt(slider_label, "%"LV_PRId32, lv_slider_get_value(slider));
      |                                         ^
In file included from /Users/username}/{path_to_folder}/HardwareTest/HardwareTest.ino:7:
/Users/{username}/Documents/Arduino/libraries/Seeed_Arduino_Round_display/src/lv_xiao_round_screen.h:37:28: error: expected type-specifier before 'Arduino_NRFXSPI'
   37 | Arduino_DataBus *bus = new Arduino_NRFXSPI(XIAO_DC, XIAO_CS, SCK, MOSI, MISO);
      |                            ^~~~~~~~~~~~~~~

exit status 1

I understand the first 2 are warnings, but the error is with Arduino_DataBus *bus = new Arduino_NRFXSPI(XIAO_DC, XIAO_CS, SCK, MOSI, MISO); - I found a similar one on the moonournation repo and tried Arduino_DataBus *bus = new Arduino_HWSPI(TFT_DC, TFT_CS, false); in /Users/{username}/Documents/Arduino/libraries/Seeed_Arduino_Round_display/src/lv_xiao_round_screen.h as was suggested but it also doesn't work.

Can I get some help fixing this please?

Metadata

Metadata

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions