# Example Library of LVGL

ใน Library ของ LVGL นั้นจะมีตัวอย่างสำเร็จรูปสำหรับให้ทดลองใช้ว่าจะแสดงผลในรูปแบบไหน โดยไฟล์ตัวอย่างนั้นจะภายใต้ folder lvgl → example → widget  โดยจะมีตัวอย่างต่างๆ มากมาย

![](/files/-MfRdBUsNeDp0-OJk34Y)

โดยที่สิ่งที่เราเห็นไปก่อนหน้านี้คือตัวอย่างของ lv\_demo\_widget เราสามารถเปลี่ยนตัวอย่างอื่นๆมาดูได้โดยเปลี่ยน code หลังบรรทัดที่ 78 ของ main.c ใต้บรรทัดที่เขียนว่า hal\_init( );

![](/files/-MfRdsEgkK1ouEmdy0OK)

ให้นิสิตลองเปลี่ยนจาก lv\_*demo\_*&#x77;idget() เป็นlv\_example\_arc\_1(); จากนั้นลอง make file (F5 หรือพิมพ์ make ใน terminal) อีกครั้ง สิ่งที่ได้คือ

![](/files/-MfRer0OGgZuq81sdYg1)

นอกจากนั้นเรายังสามารถเรียกฟังก์ชั่นของ widget อุปกรณ์อื่นๆมา run ได้โดยไฟล์เหล่านั้นจะอยู่ภายใต้โฟลเดอร์ examples ซึ่งตัวอย่างฟังก์ชั่นที่เราสามารถนำชื่อมารันได้จะมีนามสกุลเป็น .c&#x20;

![](/files/-MUI4uXd6MySIf6PEr3Y)

{% hint style="success" %}
ถ้าเราต้องการ make file ใหม่โดยไม่อยากให้ทับของเก่า เราสามารถไปตั้งชื่อไฟล์ output ใหม่ของเราได้ที่ไฟล์ Makefile ในบรรทัดที่ 33
{% endhint %}

![](/files/-MUI63W-tH5RX_L9GzD5)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aic-eec.com/general/getting-start/lvgl-light-and-versatile-embedded-graphics-library/library-lvgl.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
