aboutsummaryrefslogtreecommitdiff
path: root/examples/arduino/LVGL_Arduino/LVGL_Arduino.ino
diff options
context:
space:
mode:
Diffstat (limited to 'examples/arduino/LVGL_Arduino/LVGL_Arduino.ino')
-rw-r--r--examples/arduino/LVGL_Arduino/LVGL_Arduino.ino7
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);