UX/UI Workshops
1. ภาพรวมของ LVGL
LVGL คืออะไร?
┌─────────────────────────────────────────────────────────────┐
│ Application Layer │
│ (Your Code - GPIO, ADC, Sensors) │
├─────────────────────────────────────────────────────────────┤
│ LVGL Library │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Widgets │ │ Events │ │ Styles │ │Animation│ │
│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │
├─────────────────────────────────────────────────────────────┤
│ Display Driver │
│ (Frame Buffer, VG-Lite GPU) │
├─────────────────────────────────────────────────────────────┤
│ Hardware │
│ (LCD Display, Touch Panel) │
└─────────────────────────────────────────────────────────────┘2. สถาปัตยกรรมของ LVGL
2.1 Object Model
องค์ประกอบ
คำอธิบาย
ตัวอย่าง
WHY: ทำไมต้องเข้าใจ Object Model?
HOW: การประยุกต์ใช้จริง
CAUTION: ข้อควรระวัง
Flowchart การวาง Widget
3. Basic Widgets
3.1 Label - แสดงข้อความ
Function
หน้าที่
Parameter
WHY: ทำไม Label สำคัญ?
CAUTION: ข้อควรระวัง Label
3.2 Button - ปุ่มกด
WHY: ทำไม Button สำคัญ?
HOW: เชื่อมโยงกับ GPIO จากสัปดาห์ที่ 1
3.3 Switch - สวิตช์เปิด/ปิด
WHY: ทำไม Switch เหมาะกับ GPIO?
3.4 LED Widget - แสดงสถานะ
Function
หน้าที่
WHY: ทำไมต้องมี Virtual LED?
4. Event Handling
4.1 Event Callback Pattern
4.2 Event Types ที่สำคัญ
Event Code
เมื่อไหร่ถูกเรียก
ใช้กับ Widget
WHY: ทำไม Event-Driven สำคัญ?
HOW: ส่ง User Data ผ่าน Event
CAUTION: ข้อควรระวัง Event
Functions สำหรับการวางตำแหน่ง (LVGL v9.2 API)
Functions สำหรับการกำหนดขนาด (Size Functions)
Layout Pattern สำหรับ 480x320 Screen
Widget Sizing Guidelines (แนะนำสำหรับ 800x480)
Common Background Colors (จาก Course Examples)
CAUTION: ข้อควรระวังในการวาง Layout
Last updated
Was this helpful?