This repository has been archived on 2024-08-19. You can view files and clone it, but cannot push or open issues or pull requests.
2023-07-03 13:45:36 +03:00

32 lines
774 B
C++

/** Bare minimum example sketch for MP3 player.
*
* Simply plays all tracks in a loop.
*
* @author James Sleeman, http://sparks.gogo.co.nz/
* @license MIT License
* @file
*/
#include <Arduino.h>
#include <SoftwareSerial.h>
#include <JQ6500_Serial.h>
// Create the mp3 module object,
// Arduino Pin 8 is connected to TX of the JQ6500
// Arduino Pin 9 is connected to one end of a 1k resistor,
// the other end of the 1k resistor is connected to RX of the JQ6500
// If your Arduino is 3v3 powered, you can omit the 1k series resistor
JQ6500_Serial mp3(8,9);
void setup() {
mp3.begin(9600);
mp3.reset();
mp3.setVolume(20);
mp3.setLoopMode(MP3_LOOP_ALL);
mp3.play();
}
void loop() {
// Do nothing, it's already playing and looping :-)
}