voice.send_threelines - Kyuchumimo/Micro-Joy-Home-Video-Computer GitHub Wiki
⚠️ This control mode has one drawback: it should not be used within 23 ms after BUSY changes state, otherwise the command sent will be ignored. This is documented in the datasheet and is true. Preferably use the one-wire serial port control mode. See voice.send_oneline
🧩🔊 This is a specific-purpose audio-related function.
voice.send_threelines(addr)
Parameters
- addr: three-wire serial port control command to WT588D (0x00~0xFF).
Description
This function sends commands to the WT588D via three-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)
sclPin = Pin(28)
csPin = Pin(27)
voice = wt588d.WT588D(rstPin, sdaPin, sclPin, csPin)
| 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 |