48 lines
1.5 KiB
Markdown
48 lines
1.5 KiB
Markdown
MpDuino
|
|
=====================
|
|
|
|
A small project to interface an Arduino Uno with an OLED display,
|
|
rotary encoder to a MPD server.
|
|
|
|
|
|
Idea is to have one script `mpduino.py` creating multiple processes to
|
|
which one can attach
|
|
|
|
From PySerial to Arduino
|
|
-------------------------
|
|
|
|
A command looks like `[ES][VTAarzxcusP].*`.
|
|
Where `S` stands for set and `E` is to echo a value. The `[VTAarzxcusP]`
|
|
part selects what to set or echo. You can use `S!.*` to echo a message
|
|
back.
|
|
|
|
| Character | Property | `.*` |
|
|
|---------------|---------------|---------------------------|
|
|
| V | Volume | number |
|
|
| T | Title | text |
|
|
| A | Artist | text |
|
|
| a | album | text |
|
|
| P | Playing | empty(false)/text(true) |
|
|
| r | repeat | empty(false)/text(true) |
|
|
| z | shuffle | empty(false)/text(true) |
|
|
| x | random | empty(false)/text(true) |
|
|
| c | consume | empty(false)/text(true) |
|
|
| u | updating | empty(false)/text(true) |
|
|
| s | single | empty(false)/text(true) |
|
|
|
|
From Arduino to PySerial instance
|
|
---------------------------------
|
|
Since the Arduino has a rotary encoder for the volume and play/pause, we
|
|
need to pass these through. Next tot this, we might reset the arduino,
|
|
without resetting the pySerial script, so we need to set all values
|
|
again.
|
|
|
|
|
|
| Character | Property |
|
|
|---------------|---------------|
|
|
| R | Reset |
|
|
| V | Volume |
|
|
| P | Pause/Play |
|
|
| t | Temperature |
|
|
| h | Humidity |
|