- Complete MPU-MCU communication setup - LED Matrix text display with configurable parameters - Configuration management with personal data protection - Git template with .gitignore for sensitive data - Automated build and deployment scripts - SSH key management and service scripts
101 lines
2.5 KiB
Markdown
101 lines
2.5 KiB
Markdown
# Arduino UNO Q Template Project
|
|
|
|
Template voor Arduino UNO Q projecten met LED Matrix functionaliteit en configuratie management.
|
|
|
|
## Project Structuur
|
|
|
|
```
|
|
ArduinoUNOQ/
|
|
├── config.json # Persoonlijke configuratie (niet in git)
|
|
├── config.example.json # Template configuratie
|
|
├── lib/ # Python libraries
|
|
│ ├── config_loader.py # Configuratie loader
|
|
│ └── arduino_unoq/
|
|
│ └── bridge.py # MPU-MCU communicatie
|
|
├── src/
|
|
│ ├── mpu/ # Linux/MPU kant
|
|
│ │ └── main.py # Python applicatie
|
|
│ └── mcu/ # MCU kant
|
|
│ └── unoq_sketch/
|
|
│ ├── unoq_sketch.ino
|
|
│ ├── LEDMatrix.h
|
|
│ └── LEDMatrix.cpp
|
|
├── scripts/ # Management scripts
|
|
│ ├── status.sh
|
|
│ ├── logs.sh
|
|
│ ├── restart.sh
|
|
│ └── stop.sh
|
|
├── build.sh # Build script
|
|
├── upload.sh # Upload script
|
|
├── setup_ssh.sh # SSH setup
|
|
└── package.json # NPM scripts
|
|
```
|
|
|
|
## Snel Starten
|
|
|
|
### 1. Configuratie
|
|
```bash
|
|
# Kopieer template en pas aan
|
|
cp config.example.json config.json
|
|
# Bewerk config.json met je persoonlijke gegevens
|
|
```
|
|
|
|
### 2. SSH Setup
|
|
```bash
|
|
npm run setup
|
|
```
|
|
|
|
### 3. Build & Deploy
|
|
```bash
|
|
npm run build # Compileer MCU sketch
|
|
npm run upload # Upload naar beide processors
|
|
npm run deploy # Build + upload
|
|
```
|
|
|
|
## Configuratie
|
|
|
|
Persoonlijke gegevens in `config.json`:
|
|
|
|
```json
|
|
{
|
|
"arduino_uno_q": {
|
|
"hostname": "JOUW_UNOQ_IP",
|
|
"user": "arduino",
|
|
"ssh_key": "~/.ssh/arduino_unoq_key"
|
|
}
|
|
}
|
|
```
|
|
|
|
**Belangrijk:** `config.json` staat in `.gitignore` en wordt niet gecommit!
|
|
|
|
## LED Matrix Functionaliteit
|
|
|
|
**Command format:** `"TEXT",SPEED,TIME,DIRECTION`
|
|
|
|
- **TEXT** - Weer te geven tekst
|
|
- **SPEED** - Scroll snelheid (50-1000ms)
|
|
- **TIME** - Display tijd (1000-60000ms)
|
|
- **DIRECTION** - Richting (0°, 90°, 180°, 270°, of custom)
|
|
|
|
## Scripts
|
|
|
|
- `npm run status` - Bekijk service status
|
|
- `npm run logs` - Bekijk live logs
|
|
- `npm run restart` - Herstart applicatie
|
|
- `npm run stop` - Stop applicatie
|
|
|
|
## Git Template Gebruik
|
|
|
|
Dit project is een **template** - kopieer en pas aan:
|
|
|
|
```bash
|
|
# Nieuw project maken
|
|
git clone <repository> mijn-project
|
|
cd mijn-project
|
|
rm -rf .git
|
|
git init
|
|
# Pas config.json aan
|
|
# Begin met ontwikkelen!
|
|
```
|
|
|
|
**Veiligheid:** Persoonlijke gegevens (IP, wachtwoorden, SSH keys) worden nooit gecommit door `.gitignore`. |