diff --git a/content/hardware/10.mega/shields/giga-display-shield/tutorials/03.lvgl-guide/assets/lv_config.svg b/content/hardware/10.mega/shields/giga-display-shield/tutorials/03.lvgl-guide/assets/lv_config.svg new file mode 100644 index 0000000000..e2a0c54fba --- /dev/null +++ b/content/hardware/10.mega/shields/giga-display-shield/tutorials/03.lvgl-guide/assets/lv_config.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/content/hardware/10.mega/shields/giga-display-shield/tutorials/03.lvgl-guide/content.md b/content/hardware/10.mega/shields/giga-display-shield/tutorials/03.lvgl-guide/content.md index 08a80bfa71..d45aff7615 100644 --- a/content/hardware/10.mega/shields/giga-display-shield/tutorials/03.lvgl-guide/content.md +++ b/content/hardware/10.mega/shields/giga-display-shield/tutorials/03.lvgl-guide/content.md @@ -273,6 +273,30 @@ void loop() { } ``` +### Text + +Displaying text is usually done with labels. These are used in most of the other examples to put text on buttons and switches. Like any other element you first have to create the object with: + +```arduino +lv_obj_t * label; +``` + +Then the labels text can be set with: +```arduino +lv_label_set_text(label, "Label!"); +``` + +If you want to insert a variable that is not a string, use: + +```arduino +//This will make the label show the number 13 +lv_label_set_text_fmt(label, "%d", 13) +``` + +To use bigger font sizes it has to be enabled in the `lv_conf.h` file. This file can be found in the **mbed_giga/libraries/Arduino_H7_Video/src** folder. Find the **FONT USAGE** section, here you can see all the font sizes. If you want to enable any size simply change the `0` next to any of the font sizes into a `1`. Like this: + +![lv_config font section](assets/lv_config.svg) + ## Functional Elements ### Checkbox diff --git a/content/hardware/10.mega/shields/giga-display-shield/tutorials/10.square-line-tutorial/content.md b/content/hardware/10.mega/shields/giga-display-shield/tutorials/10.square-line-tutorial/content.md index 81e99ff311..e253a1b57c 100644 --- a/content/hardware/10.mega/shields/giga-display-shield/tutorials/10.square-line-tutorial/content.md +++ b/content/hardware/10.mega/shields/giga-display-shield/tutorials/10.square-line-tutorial/content.md @@ -98,7 +98,7 @@ Name the widgets accordingly: - **Decrease Button**: ui_ButtonDec - **Number Label**: ui_LabelNum -Also pay attention to the size of the font set for the counter label. We set the size to 26, this then needs to be enabled in the lv_conf.h file. This file can be found in /mbed/libraries/Arduino_H7_Video/src. +Also pay attention to the size of the font set for the counter label. We set the size to 26, this then needs to be enabled in the lv_conf.h file. This file can be found in the **mbed_giga/libraries/Arduino_H7_Video/src** folder. ![Font size option in SquareLine Studio](assets/text_font_size.svg)