Conclusion
ส่วนที่ 6: สรุปและแบบทดสอบ (20 นาที)
6.1 สรุปสิ่งที่เรียนรู้
IMU Sensor
BMI270, 6-axis (Accel+Gyro)
Motion sensing
Unit Conversion
lsb_to_mps2(), lsb_to_rps()
Raw → Physical
Magnitude
√(x²+y²+z²)
Motion detection
Threshold
Compare with 1g
Classify motion
Moving Average
Circular buffer + sum
Noise reduction
Statistics
Count, min, max
Analysis
6.2 ความเชื่อมโยง (Connect the Dots)
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Session 1 │───→│ Session 2 │───→│ Session 3 │
│ GPIO + ADC │ │ IMU Sensor │ │ Display │
└─────────────┘ └─────────────┘ └─────────────┘
│ │ │
▼ ▼ ▼
Potentiometer IMU Data Show data on
controls LED + Processing LVGL screen
blink speed
│
▼
┌─────────────┐
│ Session 5 │
│ ML Motion │
│ Classify │
└─────────────┘
│
▼
Use magnitude &
filtered data as
ML input features!6.3 แบบทดสอบ
1. BMI270 มี sensor อะไรบ้าง?
A) Accelerometer เท่านั้น
B) Accelerometer + Gyroscope ✓
C) Accelerometer + Gyroscope + Magnetometer
2. ค่า Magnitude เมื่อวางบอร์ดราบควรเป็นเท่าไร?
A) 0 m/s²
B) ≈ 9.81 m/s² (1g) ✓
C) ≈ 19.62 m/s² (2g)
3. Moving Average Filter มีข้อเสียอย่างไร?
A) ใช้ memory เยอะเกินไป
B) มี delay ในการตอบสนอง ✓
C) ไม่สามารถลด noise ได้
4. ฟังก์ชันใดแปลง raw accelerometer เป็น m/s²?
A)
lsb_to_rps()B)
lsb_to_mps2()✓C)
calculate_magnitude()
5. ทำไมต้อง pass struct by pointer?
A) เพราะ C บังคับ
B) เพื่อประหยัด memory และเร็วกว่า ✓
C) เพื่อป้องกันการแก้ไขค่า
6.4 ศึกษาเพิ่มเติม (การบ้าน)
อ่านเพิ่มเติม
ลองทำ
เพิ่ม Gyroscope magnitude calculation
ตรวจจับ Free Fall (magnitude ≈ 0)
ตรวจจับ Impact/Shock (magnitude > 3g)
เพิ่ม Orientation change detection
ตัวอย่างโค้ดเพิ่มเติม
Quick Reference Card
จบ Session 2 | ต่อไป: Session 3: LVGL Display
Last updated
Was this helpful?