Basic Library
Digital I/O
Analog I/O
Advanced I/O
Time
Math
Trigonometry
Random Numbers
Bits and Bytes
Interrupts
Serial Comm.
Standard Library
Camera
Servo Motor
Stepping Motor
Character LCD
SPI
I2C (Wire)
SD Card
SD (File Operations)
Periodic Operation
Clock (RTC)
Mbed Tips
Audio
Play music with the audio jack using the EasyPlayback library. WAV files saved on an SD card are played sequentially.
Example
#include <Arduino.h>
#include "SdUsbConnect.h"
#include "EasyPlayback.h"
#include "EasyDec_WavCnv2ch.h"
#define FILE_NAME_LEN (64)
#define MOUNT_NAME "storage"
static InterruptIn skip_btn(USER_BUTTON0);
static EasyPlayback AudioPlayer;
static void skip_btn_fall(void) {
AudioPlayer.skip();
}
void setup() {
DIR * d;
struct dirent * p;
char file_path[sizeof("/"MOUNT_NAME"/") + FILE_NAME_LEN];
SdUsbConnect storage(MOUNT_NAME);
// decoder setting
AudioPlayer.add_decoder