Arduino Function: RobotControl.playFile

Description

Play an audio file stored on a SD card. The file type must be .sqm The funtions Robot.beginSpeaker() and Robot.beginSD() are required in setup() before using this method. Unlike Robot.playMelody() and Robot.playBeep(), playFile() does not halt other processes while playing. However, you cannot load new images on the LCD screen when playFile() is in use. Valid files for playback are generated/converted by the sound library Squawk. See the library README for details on how to create your own music.

Syntax

Robot.playFile(filename)

Parameters

filename: file name of the music to be played

Examples

#include 

void setup(){
 Robot.begin();
 Robot.beginSpeaker();//Initialize the sound module
 Robot.beginSD();//Initialize the sd card
 Robot.playFile("melody.sqm");//Play the original music come with the robot.
}

void loop(){
 //do other stuff here
}


Based on the reference originally written by Arduino Community,  wiring.org.co and  arduino.cc