voice.send_oneline - Kyuchumimo/Micro-Joy-Home-Video-Computer GitHub Wiki
🧩🔊 This is a specific-purpose audio-related function.
voice.send_oneline(addr)
Parameters
- addr: one-wire serial port control command to WT588D (0x00~0xFF).
Description
This function sends commands to the WT588D via one-wire serial port control mode. These commands can do things like play a sound, adjust the volume, stop playback, etc.
⚠️ Note: Since the WT588D is an optional hardware component, this function requires importing the library, defining the pins and creating an object to use it.
import wt588d
rstPin = Pin(29)
sdaPin = Pin(26)
voice = wt588d.WT588D(rstPin, sdaPin)
| Command code | Function | Description |
|---|---|---|
| 0x00 | Play the zero piece voice | |
| 0x01 | Play the first piece voice | |
| 0x02 | Play the second piece voice | |
| ...... | ...... | |
| 0xD9 | Play the 217th piece voice | |
| 0xDA | Play the 218th piece voice | |
| 0xDB | Play the 219th piece voice | |
| 0xDC~0xDF | NOT USED | |
| 0xE0~0xE7 | Volume adjustment | 8 volumes can be adjusted, 0xE0 is minimum volume, and 0xE7 is the largest volume when working or standby. |
| 0xE8~0xF1 | NOT USED | |
| 0xF2 | Cycle play | The current voice addresses can be recycled when working. |
| 0xF3~0xF4 | NOT USED | |
| 0xF5 | Enter I/O extend output | In the regular three-line serial port mode, send the command can enter the extend output status of I/O port |
| 0xF6 | Exit I/O extend output | In the extend output status of I/O port, send the command can enter regular three-line serial port mode |
| 0xF7~0xFF | NOT USED |