# AZ Mandible – Prototype Code v1.0

## Files
- `AZ_Mandible_v1.ino` ← main firmware (upload this)

## Wiring (Arduino Nano)

| Component              | Arduino Pin      |
|------------------------|------------------|
| Piezo signal (after amp) | A0             |
| Bone conduction (PAM8403 signal in) | D9 (PWM) |
| Power                  | 5V / GND         |

## How to Upload
1. Install Arduino IDE
2. Select board: **Arduino Nano**
3. Select the correct COM port
4. Open `AZ_Mandible_v1.ino`
5. Click Upload

## First-Time Tuning
1. Open **Serial Plotter** (Tools → Serial Plotter)
2. Set baud to **115200**
3. Relax your jaw – note the baseline noise
4. Make a clear intentional jaw movement
5. Adjust this line until peaks are cleanly above noise:

```cpp
int threshold = 80;
```

Raise the number if it false-triggers.  
Lower it if real movements are missed.

## Current Gestures
- **1 clear peak** → YES (single tone)
- **2 quick peaks** → NO (double tone)

## Next Steps After This Works
- Add more gestures
- Adaptive thresholds per user
- Longer intent vocabulary
