Toggle Switch
Lab 4: Switch Toggle Control
Week 3 Part I - LVGL Basics
1. โครงสร้างภาพรวมของ Lab
Why? - ทำไมต้องเรียนรู้เรื่องนี้
What? - จะได้เรียนรู้อะไร
How? - ทำอย่างไร

2. หลักการทำงานและ Flowchart
2.1 Switch Widget Architecture
2.2 State Checking Pattern
2.3 GPIO Simulation Concept
2.4 Program Flowchart
3. ฟังก์ชันสำคัญ (API Reference)
3.1 Switch Creation & Control
Function
Description
Return
3.2 LED Widget Functions
Function
Description
Parameters
3.3 Event Handling
Function
Description
Return
3.4 Switch vs Button Comparison
Feature
Button
Switch
4. โค้ดตัวอย่าง (Code Examples)
4.1 Complete Code - part1_ex4_switch_toggle()
4.2 Code Breakdown
5. องค์ความรู้และเทคนิค
5.1 Switch Styling - กำหนดสี ON/OFF
5.2 Programmatic State Control
5.3 Disable/Enable Switch
5.4 User Data Pattern (สำหรับหลาย Switch)
6. แบบฝึกหัด (Exercises)
Exercise 1: Device Power Panel (Intermediate)
Exercise 2: Master Switch with Child Switches (Advanced)
7. References
Last updated
Was this helpful?