Skip to content

Commit 1dce9fd

Browse files
committed
Update for 1.0.1
PDF documentation, Fix channel names and add DRIVENO
1 parent 6c17b6f commit 1dce9fd

File tree

10 files changed

+502
-214
lines changed

10 files changed

+502
-214
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
internal

DFR0534.pdf

776 KB
Binary file not shown.

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# 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.
2+
An 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.
33

44
To create a DFR0534 object pass the existing SoftwareSerial object as parameter to the DFR0534 constructor, for example
55

@@ -14,6 +14,8 @@ DFR0534 g_audio(g_serial);
1414
...
1515
```
1616

17+
[PDF-Documentation](DFR0534.pdf)
18+
1719
Examples how to use the library
1820
- [playFileByName](/examples/playFileByName/playFileByName.ino)
1921
- [playFileByNumber](/examples/playFileByNumber/playFileByNumber.ino)
@@ -55,7 +57,7 @@ This library is licensed under the terms of the 2-Clause BSD License [Copyright
5557
| playPrevious | |
5658
| prepareFileByNumber | |
5759
| repeatPart | |
58-
| setChannel | Supports DFR0534::CHANNELMP3, DFR0534::CHANNELDAC and DFR0534::CHANNELMP3AUX |
60+
| setChannel | Seems make no sense on a DFR0534 audio module |
5961
| setDrive | Supports DFR0534::DRIVEUSB, DFR0534::DRIVESD and DFR0534::DRIVEFLASH |
6062
| setDirectory | Seems not to work |
6163
| setEqualizer | Supports DFR0534::NORMAL, DFR0534::POP, DFR0534::ROCK, DFR0534::JAZZ and DFR0534::CLASSIC |
@@ -76,7 +78,7 @@ For function details see comments in [DFR0534.cpp](src/DFR0534.cpp)
7678
![DFR0534](assets/images/DFR0534.jpg)
7779

7880
Minimal schematic to use this library
79-
| Pin | Connteced to |
81+
| Pin | Connected to |
8082
| ------------- | ------------- |
8183
| TX | Used SoftwareSerial RX |
8284
| RX | Used SoftwareSerial TX* |

examples/playCombined/playCombined.ino

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/*
1+
/*
22
* Example for using the DFR0534 for playing combined audio files like a playlist
3-
*/
3+
*/
44

55
#include <SoftwareSerial.h>
66
#include <DFR0534.h>
@@ -17,25 +17,25 @@ void setup() {
1717
g_serial.begin(9600);
1818

1919
// Set volume
20-
g_audio.setVolume(20);
21-
22-
/* The parameter string for the playCombined function is just
23-
* a concatenation of all files in the desired order without
20+
g_audio.setVolume(18);
21+
22+
/* The parameter string for the playCombined function is just
23+
* a concatenation of all files in the desired order without
2424
* path and without extension.
2525
* All files have to be in the folder /ZH and the each
26-
* file has to have a length (without extension) of two chars.
26+
* file has to have a length (without extension) of two chars.
2727
*
2828
* You can get example files from https://github.com/codingABI/DFR0534/tree/main/assets/exampleContent
2929
*/
3030

31-
/* Plays files the custom order, like a playlist and stops after the last file:
31+
/* Plays files the custom order, like a playlist and stops after the last file:
3232
* /ZH/05.wav
3333
* /ZH/04.wav
3434
* /ZH/03.wav
3535
* /ZH/02.wav
3636
* /ZH/01.wav
3737
* /ZH/0A.wav
38-
*/
38+
*/
3939
g_audio.playCombined("05040302010A");
4040
}
4141

@@ -48,10 +48,10 @@ void loop() {
4848
Serial.print("number: ");
4949
word fileNumber = g_audio.getFileNumber();
5050
if (fileNumber > 0) Serial.print(fileNumber); else Serial.print("--");
51-
51+
5252
Serial.print(" name: ");
5353
if (g_audio.getFileName(name)) Serial.print(name);
54-
54+
5555
Serial.print(" status: ");
5656
switch (g_audio.getStatus()) {
5757
case DFR0534::STOPPED:

examples/playFileByName/playFileByName.ino

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/*
1+
/*
22
* Example for using the DFR0534 for playing audio files by file name
3-
*/
3+
*/
44

55
#include <SoftwareSerial.h>
66
#include <DFR0534.h>
@@ -17,17 +17,22 @@ void setup() {
1717
g_serial.begin(9600);
1818

1919
// Set volume
20-
g_audio.setVolume(20);
21-
22-
/* The parameter string for the function playFileByName is the full path
23-
* of the audio file to be played in special format which looks like
24-
* a 8+3 format:
25-
* - without the dot for the file extension
26-
* - every file and folder which length is shorter then
27-
* 8 chars must be filled up to the 8 chars length by spaces.
20+
g_audio.setVolume(18);
21+
22+
/* The file name/path for the function playFileByName() is the full path of the audio file to be played
23+
* in format which looks like a special unix 8+3 format:
24+
* - Without the dot for the file extension
25+
* - All characters in upper case
26+
* - Every file and folder whose length is shorter then 8 chars must be filled up to the 8 chars length by spaces.
2827
* - Only WAV and MP3 files are supported
29-
* Wildcards * and ? are allowed and can be used to reduce
30-
* filling spaces.
28+
* Wildcards * (=multiple arbitrary characters) and ? (=one single arbitrary character) are allowed and can be used to reduce filling spaces.
29+
*
30+
* Valid examples:
31+
* - "/01 WAV" for file 01.wav
32+
* - "/99-AFR~1MP3" for a file /99-Africa.mp3
33+
* - "/99-AFR*MP3" for first file matching /99-Afr*.mp3
34+
* - "/10*" for first audio file matching /10*.*
35+
* - "/10 /20 WAV" for the file /10/20.wav
3136
*
3237
* You can get example files from https://github.com/codingABI/DFR0534/tree/main/assets/exampleContent
3338
*
@@ -52,10 +57,10 @@ void loop() {
5257
Serial.print("number: ");
5358
word fileNumber = g_audio.getFileNumber();
5459
if (fileNumber > 0) Serial.print(fileNumber); else Serial.print("--");
55-
60+
5661
Serial.print(" name: ");
5762
if (g_audio.getFileName(name)) Serial.print(name);
58-
63+
5964
Serial.print(" status: ");
6065
switch (g_audio.getStatus()) {
6166
case DFR0534::STOPPED:

examples/playFileByNumber/playFileByNumber.ino

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/*
1+
/*
22
* Example for using the DFR0534 for playing audio files by file number
3-
*/
3+
*/
44

55
#include <SoftwareSerial.h>
66
#include <DFR0534.h>
@@ -17,16 +17,16 @@ void setup() {
1717
g_serial.begin(9600);
1818

1919
// Set volume
20-
g_audio.setVolume(20);
21-
20+
g_audio.setVolume(18);
21+
2222
// Show some device infos
2323
Serial.print("Ready drives: ");
2424
byte drive = g_audio.getDrivesStates();
2525
if (((drive >> DFR0534::DRIVEUSB) & 1) == 1) Serial.print("USB ");
2626
if (((drive >> DFR0534::DRIVESD) & 1) == 1) Serial.print("SD ");
27-
if (((drive >> DFR0534::DRIVEFLASH) & 1) == 1) Serial.print("FLASH ");
27+
if (((drive >> DFR0534::DRIVEFLASH) & 1) == 1) Serial.print("FLASH ");
2828
Serial.println();
29-
29+
3030
Serial.print("Current playing drive: ");
3131
switch(g_audio.getDrive()) {
3232
case DFR0534::DRIVEUSB:
@@ -38,6 +38,9 @@ void setup() {
3838
case DFR0534::DRIVEFLASH:
3939
Serial.println("FLASH");
4040
break;
41+
case DFR0534::DRIVENO:
42+
Serial.println("No drive");
43+
break;
4144
default:
4245
Serial.println("Unknown");
4346
break;
@@ -65,10 +68,10 @@ void loop() {
6568
Serial.print("number: ");
6669
word fileNumber = g_audio.getFileNumber();
6770
if (fileNumber > 0) Serial.print(fileNumber); else Serial.print("--");
68-
71+
6972
Serial.print(" name: ");
7073
if (g_audio.getFileName(name)) Serial.print(name);
71-
74+
7275
Serial.print(" status: ");
7376
switch (g_audio.getStatus()) {
7477
case DFR0534::STOPPED:

keywords.txt

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,58 +12,58 @@ DFR0534 KEYWORD1
1212
# Methods and Functions (KEYWORD2)
1313
#######################################
1414

15-
getStatus KEYWORD2
16-
setEqualizer KEYWORD2
17-
playFileByNumber KEYWORD2
18-
setVolume KEYWORD2
19-
play KEYWORD2
20-
pause KEYWORD2
21-
stop KEYWORD2
22-
playPrevious KEYWORD2
23-
playNext KEYWORD2
24-
playFileByName KEYWORD2
25-
getDrivesStates KEYWORD2
15+
decreaseVolume KEYWORD2
16+
fastBackwardDuration KEYWORD2
17+
fastForwardDuration KEYWORD2
2618
getDrive KEYWORD2
27-
setDrive KEYWORD2
19+
getDrivesStates KEYWORD2
20+
getDuration KEYWORD2
21+
getFileName KEYWORD2
2822
getFileNumber KEYWORD2
29-
getTotalFiles KEYWORD2
30-
playLastInDirectory KEYWORD2
31-
playNextDirectory KEYWORD2
3223
getFirstFileNumberInCurrentDirectory KEYWORD2
24+
getRuntime KEYWORD2
25+
getStatus KEYWORD2
26+
getTotalFiles KEYWORD2
3327
getTotalFilesInCurrentDirectory KEYWORD2
3428
increaseVolume KEYWORD2
35-
decreaseVolume KEYWORD2
3629
insertFileByNumber KEYWORD2
37-
stopInsertedFile KEYWORD2
30+
pause KEYWORD2
31+
play KEYWORD2
32+
playCombined KEYWORD2
33+
playFileByName KEYWORD2
34+
playFileByNumber KEYWORD2
35+
playLastInDirectory KEYWORD2
36+
playNext KEYWORD2
37+
playNextDirectory KEYWORD2
38+
playPrevious KEYWORD2
39+
prepareFileByNumber KEYWORD2
40+
repeatPart KEYWORD2
41+
setChannel KEYWORD2
3842
setDirectory KEYWORD2
43+
setDrive KEYWORD2
44+
setEqualizer KEYWORD2
3945
setLoopMode KEYWORD2
4046
setRepeatLoops KEYWORD2
41-
playCombined KEYWORD2
47+
setVolume KEYWORD2
48+
startSendingRuntime KEYWORD2
49+
stop KEYWORD2
4250
stopCombined KEYWORD2
43-
setChannel KEYWORD2
44-
getFileName KEYWORD2
45-
prepareFileByNumber KEYWORD2
46-
repeatPart KEYWORD2
51+
stopInsertedFile KEYWORD2
4752
stopRepeatPart KEYWORD2
48-
fastBackwardDuration KEYWORD2
49-
fastForwardDuration KEYWORD2
50-
getDuration KEYWORD2
51-
startSendingRuntime KEYWORD2
52-
getRuntime KEYWORD2
5353
stopSendingRuntime KEYWORD2
5454

5555
#######################################
5656
# Constants (LITERAL1)
5757
#######################################
5858

59-
STATUSUNKNOWN LITERAL1
6059
CHANNELMP3 LITERAL1
61-
CHANNELDAC LITERAL1
60+
CHANNELAUX LITERAL1
6261
CHANNELMP3AUX LITERAL1
6362
CHANNELUNKNOWN LITERAL1
6463
DRIVEUSB LITERAL1
6564
DRIVESD LITERAL1
6665
DRIVEFLASH LITERAL1
66+
DRIVENO LITERAL1
6767
DRIVEUNKNOWN LITERAL1
6868
LOOPBACKALL LITERAL1
6969
SINGLEAUDIOLOOP LITERAL1

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name=DRF0534
2-
version=1.0.0
1+
name=DFR0534
2+
version=1.0.1
33
author=codingABI
44
maintainer=codingABI
55
sentence=Class for controlling a DFR0534 audio module by SoftwareSerial

0 commit comments

Comments
 (0)