Skip to content

Commit

Permalink
Merge pull request #31 from rzeldent/develop
Browse files Browse the repository at this point in the history
Added QR code
  • Loading branch information
rzeldent committed Mar 17, 2024
2 parents 97a1ce2 + 37ca3a1 commit 51fb8b0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/lv_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@
#define LV_USE_GIF 0

/*QR code library*/
#define LV_USE_QRCODE 0
#define LV_USE_QRCODE 1

/*FreeType library*/
#define LV_USE_FREETYPE 0
Expand Down
10 changes: 5 additions & 5 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ monitor_filters = esp32_exception_decoder
build_flags =
-Ofast
-Wall
-D 'BOARD_NAME="${this.board}"'
-D 'CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_INFO'
#-D 'CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG'
#-D 'CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE'
-D'LV_CONF_PATH=${platformio.include_dir}/lv_conf.h'
'-D BOARD_NAME="${this.board}"'
'-D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_INFO'
#'-D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG'
#'-D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE'
'-D LV_CONF_PATH=${platformio.include_dir}/lv_conf.h'

lib_deps =
https://github.com/rzeldent/esp32-smartdisplay
Expand Down
8 changes: 8 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <esp32_smartdisplay.h>
#include <ui/ui.h>

#include <src/extra/libs/qrcode/lv_qrcode.h>

void OnAddOneClicked(lv_event_t *e)
{
static uint8_t cnt = 0;
Expand Down Expand Up @@ -38,6 +40,12 @@ void setup()
// lv_disp_set_rotation(disp, LV_DISP_ROT_270);

ui_init();

// To use third party libraries, enable the define in lv_conf.h: #define LV_USE_QRCODE 1
auto ui_qrcode = lv_qrcode_create(ui_scrMain, 100, lv_color_black(), lv_color_white());
const char *qr_data = "https://github.com/rzeldent/esp32-smartdisplay";
lv_qrcode_update(ui_qrcode, qr_data, strlen(qr_data));
lv_obj_center(ui_qrcode);
}

ulong next_millis;
Expand Down

0 comments on commit 51fb8b0

Please sign in to comment.