From 2b5626878a88db73ed695dea0e0e03fc759f439e Mon Sep 17 00:00:00 2001 From: marqdevx Date: Wed, 9 Jun 2021 10:01:12 +0200 Subject: [PATCH 1/8] Added LVGL sketch --- .../lvglCounter/lvglCounter.ino | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 examples/Creating GUIs with LVGL/lvglCounter/lvglCounter.ino diff --git a/examples/Creating GUIs with LVGL/lvglCounter/lvglCounter.ino b/examples/Creating GUIs with LVGL/lvglCounter/lvglCounter.ino new file mode 100644 index 0000000..dc20240 --- /dev/null +++ b/examples/Creating GUIs with LVGL/lvglCounter/lvglCounter.ino @@ -0,0 +1,39 @@ +#include "Portenta_LittleVGL.h" + +static lv_obj_t *label; +int counter = 0; + +static void updateCounterTask(lv_task_t *task) { + // Print the count to the Serial monitor + Serial.println(counter); + + // Update the text of the label + lv_label_set_text_fmt(label, "%d" , counter); + + // Increase the count number + counter++; +} + +void setup() { + Serial.begin(9600); + + // Initialize Portenta's video interface + portenta_init_video(); + + // Setting up the label making it a child of the screen + label = lv_label_create(lv_scr_act(), NULL); + + // Set the label's text + lv_label_set_text(label , "Counter"); + + // We move it to the center of the screen and align it centered + lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0); + + // Create a task to update the counter + lv_task_create(updateCounterTask, 1000, LV_TASK_PRIO_MID, NULL); +} + +void loop() { + // put your main code here, to run repeatedly: + lv_task_handler(); +} \ No newline at end of file From bb5213b85c826849dbe2cecf7d63ccc0af823a60 Mon Sep 17 00:00:00 2001 From: marqdevx Date: Wed, 9 Jun 2021 10:02:06 +0200 Subject: [PATCH 2/8] Added lvgl version caption --- examples/Creating GUIs with LVGL/lvglCounter/lvglCounter.ino | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/Creating GUIs with LVGL/lvglCounter/lvglCounter.ino b/examples/Creating GUIs with LVGL/lvglCounter/lvglCounter.ino index dc20240..0f0a7e0 100644 --- a/examples/Creating GUIs with LVGL/lvglCounter/lvglCounter.ino +++ b/examples/Creating GUIs with LVGL/lvglCounter/lvglCounter.ino @@ -1,3 +1,7 @@ +/* + Using LVGL v7.11 +*/ + #include "Portenta_LittleVGL.h" static lv_obj_t *label; From 21f495f5b77f256bfd56f3f863f8aec9dc737c50 Mon Sep 17 00:00:00 2001 From: marqdevx Date: Wed, 9 Jun 2021 10:03:44 +0200 Subject: [PATCH 3/8] Increased version --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index 9741b06..6237097 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Arduino_Pro_Tutorials -version=1.0.3 +version=1.0.4 author=Martino Facchin, Riccardo Ricco, Dario Pennisi, Sebastian Romero, Lenard George, Ignacio Herrera, Jose García, Pablo Marquínez maintainer=Arduino sentence=This library contains the complete Arduino sketches from the Pro Tutorials. From 694a2b9811489043f03a2026fdec0a26c7ea8042 Mon Sep 17 00:00:00 2001 From: marqdevx Date: Wed, 9 Jun 2021 10:04:04 +0200 Subject: [PATCH 4/8] Added LVGL sketch to the compile list --- .github/workflows/compile-examples.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 5e5bfa8..2987667 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -39,6 +39,7 @@ jobs: sketch-paths: | - examples/BLE Connectivity on Portenta H7/PortentaBLE - examples/Creating a Flash-Optimised Key-Value Store/FlashKeyValue + - examples/Creating GUIs with LVGL/lvglCounter - examples/Dual Core Processing/BlinkRedLed - examples/Dual Core Processing/BlinkRedLed_M7 - examples/Portenta H7 as a USB Host/LEDKeyboardController From 9de61a6f78cae3f1bfb96c315f85a84fb9322c53 Mon Sep 17 00:00:00 2001 From: marqdevx Date: Fri, 11 Jun 2021 11:25:22 +0200 Subject: [PATCH 5/8] CI: added lvgl library --- .github/workflows/compile-examples.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 2987667..b3ec627 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -68,6 +68,7 @@ jobs: # Install library dependencies. - name: ArduinoBLE - name: Arduino_EdgeControl + - name: lvgl sketch-paths: | # Sketches to compile for all boards From ad43bd00498e2b7acd41765a522280452ccc1ea1 Mon Sep 17 00:00:00 2001 From: marqdevx Date: Fri, 11 Jun 2021 11:36:20 +0200 Subject: [PATCH 6/8] CI: added lvgl version --- .github/workflows/compile-examples.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index b3ec627..c7483ac 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -69,6 +69,7 @@ jobs: - name: ArduinoBLE - name: Arduino_EdgeControl - name: lvgl + - version: 7.11 sketch-paths: | # Sketches to compile for all boards From 22a949fe9358d21078abdb7e8490eae4f57281c6 Mon Sep 17 00:00:00 2001 From: marqdevx Date: Fri, 11 Jun 2021 11:42:11 +0200 Subject: [PATCH 7/8] CI: fix lvgl version --- .github/workflows/compile-examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index c7483ac..62db0d2 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -69,7 +69,7 @@ jobs: - name: ArduinoBLE - name: Arduino_EdgeControl - name: lvgl - - version: 7.11 + version: 7.11 sketch-paths: | # Sketches to compile for all boards From d9f4e63e8387ee4cc1db8d6cf73720aa3f8e27e2 Mon Sep 17 00:00:00 2001 From: marqdevx Date: Fri, 11 Jun 2021 11:45:02 +0200 Subject: [PATCH 8/8] CI: fix lvgl version --- .github/workflows/compile-examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 62db0d2..471d753 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -69,7 +69,7 @@ jobs: - name: ArduinoBLE - name: Arduino_EdgeControl - name: lvgl - version: 7.11 + version: 7.11.0 sketch-paths: | # Sketches to compile for all boards