diff options
author | Klaus Musch <kmusch@gmail.com> | 2024-04-06 12:10:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-06 12:10:32 +0200 |
commit | b74d34407fa5f332b8447e46a971e5e05cf9bd5a (patch) | |
tree | d93e01fad352faf698c6b4a6f5d06de8dff5def5 /examples/arduino/LVGL_Arduino | |
parent | 3e21769fa6fc107023fdbcea04a3372a4d2bf55b (diff) | |
download | lvgl-b74d34407fa5f332b8447e46a971e5e05cf9bd5a.tar.gz lvgl-b74d34407fa5f332b8447e46a971e5e05cf9bd5a.zip |
feat(example): make "LVGL_Arduino.ino" easier to use (#6001)
Diffstat (limited to 'examples/arduino/LVGL_Arduino')
-rw-r--r-- | examples/arduino/LVGL_Arduino/LVGL_Arduino.ino | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/arduino/LVGL_Arduino/LVGL_Arduino.ino b/examples/arduino/LVGL_Arduino/LVGL_Arduino.ino index 04a79f9d1..94ec0c854 100644 --- a/examples/arduino/LVGL_Arduino/LVGL_Arduino.ino +++ b/examples/arduino/LVGL_Arduino/LVGL_Arduino.ino @@ -1,5 +1,5 @@ /*Using LVGL with Arduino requires some extra steps: - *Be sure to read the docs here: https://docs.lvgl.io/master/get-started/platforms/arduino.html */ + *Be sure to read the docs here: https://docs.lvgl.io/master/integration/framework/arduino.html */ #include <lvgl.h> @@ -15,9 +15,10 @@ //#include <examples/lv_examples.h> //#include <demos/lv_demos.h> -/*Set to your screen resolution*/ +/*Set to your screen resolution and rotation*/ #define TFT_HOR_RES 320 #define TFT_VER_RES 240 +#define TFT_ROTATION LV_DISPLAY_ROTATION_0 /*LVGL draw into this buffer, 1/10 screen size usually works well. The size is in bytes*/ #define DRAW_BUF_SIZE (TFT_HOR_RES * TFT_VER_RES / 10 * (LV_COLOR_DEPTH / 8)) @@ -95,6 +96,8 @@ void setup() #if LV_USE_TFT_ESPI /*TFT_eSPI can be enabled lv_conf.h to initialize the display in a simple way*/ disp = lv_tft_espi_create(TFT_HOR_RES, TFT_VER_RES, draw_buf, sizeof(draw_buf)); + lv_display_set_rotation(disp, TFT_ROTATION); + #else /*Else create a display yourself*/ disp = lv_display_create(TFT_HOR_RES, TFT_VER_RES); |