How byt-ctrl/arduino-led-gesture works
Main Components
a. Hardware
• Webcam (video input)
• Host Computer (runs Python code)
• Arduino Uno (runs StandardFirmata firmware)
• LED Array (5 LEDs + resistors + jumper wires)
b. Software
• Python Application
• VideoCapture Module (OpenCV)
• Hand-Tracking Module (MediaPipe)
• Gesture Logic (finger counting → mapping to LED count)
• Arduino Interface (PyFirmata serial communication)
• Arduino Firmware
• StandardFirmata (handles incoming commands, toggles pins)
Interactions and Data Flows
1) Webcam → VideoCapture (raw frames)
2) VideoCapture → Hand-Tracking (detect landmarks)
3) Hand-Tracking → Gesture Logic (compute N fingers held up)
4) Gesture Logic → Arduino Interface (send “set digital pin 1..N HIGH”)
5) Arduino Interface → Serial over USB → Arduino Uno Firmware
6) Arduino Firmware → Digital I/O pins → LED hardware
Architectural Patterns
• Real-time processing loop in Python: capture → process → actuate.
• Separation of concerns: Vision (OpenCV + MediaPipe) vs. Control (PyFirmata).
• External firmware (Firmata) as a thin hardware abstraction layer.
Technologies and Frameworks
• OpenCV (cv2) for frame grabbing
• MediaPipe for hand-landmark detection
• PyFirmata for serial messaging to Arduino
• StandardFirmata on the Arduino side
• Python 3.7–3.10