32 #ifndef JQ6500Serial_h
33 #define JQ6500Serial_h
35 #include <SoftwareSerial.h>
37 #define MP3_EQ_NORMAL 0
41 #define MP3_EQ_CLASSIC 4
44 #define MP3_SRC_SDCARD 1
45 #define MP3_SRC_BUILTIN 4
56 #define MP3_LOOP_ALL 0
57 #define MP3_LOOP_FOLDER 1
58 #define MP3_LOOP_ONE 2
59 #define MP3_LOOP_RAM 3
60 #define MP3_LOOP_ONE_STOP 4
61 #define MP3_LOOP_NONE 4
63 #define MP3_STATUS_STOPPED 0
64 #define MP3_STATUS_PLAYING 1
65 #define MP3_STATUS_PAUSED 2
76 #define MP3_STATUS_CHECKS_IN_AGREEMENT 4
381 void sendCommand(byte command, byte arg1, byte arg2,
char *responseBuffer,
unsigned int bufferLength);
386 void sendCommand(byte command, byte arg1, byte arg2);
400 unsigned int getVersion();
402 size_t readBytesUntilAndIncluding(
char terminator,
char *buffer,
size_t length, byte maxOneLineOnly = 0);
404 int waitUntilAvailable(
unsigned long maxWaitTime = 1000);
void nextFolder()
Play the next folder.
Definition: JQ6500_Serial.cpp:69
unsigned int sendCommandWithUnsignedIntResponse(byte command)
Send a command to the JQ6500 module, and get a response.
Definition: JQ6500_Serial.cpp:198
JQ6500_Serial(short rxPin, short txPin)
Create JQ6500 object.
Definition: JQ6500_Serial.h:112
void playFileNumberInFolderNumber(unsigned int folderNumber, unsigned int fileNumber)
Play a specific file in a specific folder based on the name of those folder and file.
Definition: JQ6500_Serial.cpp:79
void sendCommand(byte command, byte arg1, byte arg2, char *responseBuffer, unsigned int bufferLength)
Send a command to the JQ6500 module,.
Definition: JQ6500_Serial.cpp:220
void setVolume(byte volumeFrom0To30)
Set the volume to a specific level (0 to 30).
Definition: JQ6500_Serial.cpp:94
void pause()
Pause the current file.
Definition: JQ6500_Serial.cpp:49
void reset()
Reset the device (softly).
Definition: JQ6500_Serial.cpp:119
void volumeDn()
Decrease the volume by 1 (volume ranges 0 to 30).
Definition: JQ6500_Serial.cpp:89
unsigned int currentFileLengthInSeconds()
For the currently playing or paused file, return the total length of the file in seconds.
Definition: JQ6500_Serial.cpp:189
unsigned int countFolders(byte source)
Count the number of folders on the specified media.
Definition: JQ6500_Serial.cpp:164
void play()
Start playing the current file.
Definition: JQ6500_Serial.cpp:34
byte getLoopMode()
Get loop mode.
Definition: JQ6500_Serial.cpp:147
void setEqualizer(byte equalizerMode)
Set the equalizer to one of 6 preset modes.
Definition: JQ6500_Serial.cpp:99
void restart()
Restart the current (possibly paused) track from the beginning.
Definition: JQ6500_Serial.cpp:39
byte getEqualizer()
Get the equalizer mode.
Definition: JQ6500_Serial.cpp:146
void next()
Play the next file.
Definition: JQ6500_Serial.cpp:54
void currentFileName(char *buffer, unsigned int bufferLength)
Get the name of the "current" file on the SD Card.
Definition: JQ6500_Serial.cpp:191
byte getVolume()
Get the current volume level.
Definition: JQ6500_Serial.cpp:145
void volumeUp()
Increase the volume by 1 (volume ranges 0 to 30).
Definition: JQ6500_Serial.cpp:84
unsigned int currentFileIndexNumber(byte source)
For the currently playing (or paused, or file that would be played next if stopped) file...
Definition: JQ6500_Serial.cpp:174
unsigned int currentFilePositionInSeconds()
For the currently playing or paused file, return the current position in seconds. ...
Definition: JQ6500_Serial.cpp:188
unsigned int countFiles(byte source)
Count the number of files on the specified media.
Definition: JQ6500_Serial.cpp:150
Definition: JQ6500_Serial.h:80
void setLoopMode(byte loopMode)
Set the looping mode.
Definition: JQ6500_Serial.cpp:104
void prev()
Play the previous file.
Definition: JQ6500_Serial.cpp:59
byte getStatus()
Get the status from the device.
Definition: JQ6500_Serial.cpp:126
void prevFolder()
Play the previous folder.
Definition: JQ6500_Serial.cpp:74
void setSource(byte source)
Set the source to read mp3 data from.
Definition: JQ6500_Serial.cpp:109
void playFileByIndexNumber(unsigned int fileNumber)
Play a specific file based on it's (FAT table) index number.
Definition: JQ6500_Serial.cpp:64
void sleep()
Put the device to sleep.
Definition: JQ6500_Serial.cpp:114