Skip to content

Commit 6c17b6f

Browse files
committed
Init
0 parents  commit 6c17b6f

38 files changed

+1554
-0
lines changed

LICENSE.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
BSD 2-Clause License
2+
3+
Copyright (c) 2024, codingABI All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6+
7+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8+
9+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
10+
11+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# DFR0534
2+
Arduino Uno/Nano library for a [DFR0534](https://wiki.dfrobot.com/Voice_Module_SKU__DFR0534) audio module. The library works with SoftwareSerial and is very similar to https://github.com/sleemanj/JQ8400_Serial, but is no fork.
3+
4+
To create a DFR0534 object pass the existing SoftwareSerial object as parameter to the DFR0534 constructor, for example
5+
6+
```
7+
#include <SoftwareSerial.h>
8+
#include <DFR0534.h>
9+
10+
#define TX_PIN A0
11+
#define RX_PIN A1
12+
SoftwareSerial g_serial(RX_PIN, TX_PIN);
13+
DFR0534 g_audio(g_serial);
14+
...
15+
```
16+
17+
Examples how to use the library
18+
- [playFileByName](/examples/playFileByName/playFileByName.ino)
19+
- [playFileByNumber](/examples/playFileByNumber/playFileByNumber.ino)
20+
- [playCombined](/examples/playCombined/playCombined.ino)
21+
22+
## License and copyright
23+
This library is licensed under the terms of the 2-Clause BSD License [Copyright (c) 2024 codingABI](LICENSE.txt).
24+
25+
## Appendix
26+
27+
### Supported functions
28+
29+
30+
| Function | Notes |
31+
| ------------- | ------------- |
32+
| decreaseVolume | |
33+
| fastBackwardDuration | |
34+
| fastForwardDuration | |
35+
| getDrive | Returns DFR0534::DRIVEUSB, DFR0534::DRIVESD, DFR0534::DRIVEFLASH or DFR0534::DRIVEUNKNOWN, Example [playFileByNumber](/examples/playFileByNumber/playFileByNumber.ino) |
36+
| getDrivesStates | Returns bitmask for DFR0534::DRIVEUSB, DFR0534::DRIVESD, DFR0534::DRIVEFLASH, Example [playFileByNumber](/examples/playFileByNumber/playFileByNumber.ino) |
37+
| getDuration | |
38+
| getFileName | Example [playFileByNumber](/examples/playFileByNumber/playFileByNumber.ino) |
39+
| getFileNumber | Example [playFileByNumber](/examples/playFileByNumber/playFileByNumber.ino) |
40+
| getFirstFileNumberInCurrentDirectory | Example [playFileByNumber](/examples/playFileByNumber/playFileByNumber.ino) |
41+
| getRuntime | |
42+
| getStatus | Returns DFR0534::STOPPED, DFR0534::PLAYING, DFR0534::PAUSED or DFR0534::STATUSUNKNOWN, Example [playFileByNumber](/examples/playFileByNumber/playFileByNumber.ino)|
43+
| getTotalFiles | Example [playFileByNumber](/examples/playFileByNumber/playFileByNumber.ino) |
44+
| getTotalFilesInCurrentDirectory | Example [playFileByNumber](/examples/playFileByNumber/playFileByNumber.ino) |
45+
| increaseVolume | |
46+
| insertFileByNumber | |
47+
| pause | |
48+
| play | |
49+
| playCombined | The DFR0534 uses a special two char file name format and fixed folder /ZH for this function. Look a the a the example [playCombined](/examples/playCombined/playCombined.ino) or comments to this function in [DFR0534.cpp](src/DFR0534.cpp) for details |
50+
| playFileByName | The DFR0534 uses a special 8+3 file name format. Before using this function take a look a the example [playFileByName](/examples/playFileByName/playFileByName.ino) or the comments to this function in [DFR0534.cpp](src/DFR0534.cpp) for details |
51+
| playFileByNumber | Example [playFileByNumber](/examples/playFileByNumber/playFileByNumber.ino) |
52+
| playLastInDirectory | |
53+
| playNext | |
54+
| playNextDirectory | |
55+
| playPrevious | |
56+
| prepareFileByNumber | |
57+
| repeatPart | |
58+
| setChannel | Supports DFR0534::CHANNELMP3, DFR0534::CHANNELDAC and DFR0534::CHANNELMP3AUX |
59+
| setDrive | Supports DFR0534::DRIVEUSB, DFR0534::DRIVESD and DFR0534::DRIVEFLASH |
60+
| setDirectory | Seems not to work |
61+
| setEqualizer | Supports DFR0534::NORMAL, DFR0534::POP, DFR0534::ROCK, DFR0534::JAZZ and DFR0534::CLASSIC |
62+
| setLoopMode | Supports DFR0534::LOOPBACKALL, DFR0534::SINGLEAUDIOLOOP, DFR0534::SINGLEAUDIOSTOP, DFR0534::PLAYRANDOM, DFR0534::DIRECTORYLOOP, DFR0534::RANDOMINDIRECTORY, DFR0534::SEQUENTIALINDIRECTORY and DFR0534::SEQUENTIAL |
63+
| setRepeatLoops | |
64+
| setVolume | Volume level (0 = mute, 30 = max), Example [playFileByNumber](/examples/playFileByNumber/playFileByNumber.ino) |
65+
| startSendingRuntime | |
66+
| stop | |
67+
| stopCombined | |
68+
| stopInsertedFile | |
69+
| stopRepeatPart | |
70+
| stopSendingRuntime | |
71+
72+
For function details see comments in [DFR0534.cpp](src/DFR0534.cpp)
73+
74+
75+
### DF0534 pinout
76+
![DFR0534](assets/images/DFR0534.jpg)
77+
78+
Minimal schematic to use this library
79+
| Pin | Connteced to |
80+
| ------------- | ------------- |
81+
| TX | Used SoftwareSerial RX |
82+
| RX | Used SoftwareSerial TX* |
83+
| GND | Ground |
84+
| VCC | 3.3-5V |
85+
| SP+ | Speaker + connector |
86+
| SP- | Speaker - connector |
87+
88+
*If your microcontroller runs at 5V use a 1k resistor between RX and SoftwareSerial TX.
89+
90+

assets/exampleContent/ZH/00.wav

41.1 KB
Binary file not shown.

assets/exampleContent/ZH/01.wav

40.8 KB
Binary file not shown.

assets/exampleContent/ZH/02.wav

35.7 KB
Binary file not shown.

assets/exampleContent/ZH/03.wav

39.9 KB
Binary file not shown.

assets/exampleContent/ZH/04.wav

42.9 KB
Binary file not shown.

assets/exampleContent/ZH/05.wav

43.6 KB
Binary file not shown.

assets/exampleContent/ZH/06.wav

46.1 KB
Binary file not shown.

assets/exampleContent/ZH/07.wav

46.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)