Sun Aug 10, 2014 1:06 pm
Mon Aug 11, 2014 8:24 am
Mon Aug 11, 2014 9:11 am
Mon Aug 11, 2014 8:39 pm
Fri Aug 15, 2014 2:31 pm
Fri Aug 15, 2014 3:03 pm
deepsheet wrote:I was planning on making a simple wav player but lost interest in favor to other Gamebuino apps I'm planning
Sun Jan 11, 2015 11:42 pm
#include <SD.h>
#include <SPI.h>
#include <Gamebuino.h>
#include <TMRpcm.h>
Gamebuino gb;
TMRpcm tmrpcm;
#define SD_ChipSelectPin 10
#define SPEAKER 3
File dataFile;
void setup(){
pinMode(SD_ChipSelectPin, OUTPUT);
pinMode(SPEAKER, OUTPUT);
tmrpcm.speakerPin = SPEAKER; //5,6,11 or 46 on Mega, 9 on Uno, Nano, etc
gb.begin();
Serial.begin(9600);
if (!SD.begin(SD_ChipSelectPin)) { // see if the card is present and can be initialized:
Serial.println("SD fail");
return; // don't do anything more if not
}else
{
Serial.println("SD Ok");
}
initGame(); // Titlescreen
}
void initGame(){
gb.titleScreen(F("Quosa's Spacedelivery"));
//gb.popup(F("Game is not Saved!"), 100);
}
void loop(){
if(gb.update()){
if(gb.buttons.pressed(BTN_A)){
tmrpcm.play("2.wav");}
}
}
Thu May 21, 2015 11:40 am
quosa wrote:Program runs with gamebuino library and TMRpcm-WAV library but hangs after playing first wav; any idea?
- Code:
#include <SD.h>
#include <SPI.h>
#include <Gamebuino.h>
#include <TMRpcm.h>
Gamebuino gb;
TMRpcm tmrpcm;
#define SD_ChipSelectPin 10
#define SPEAKER 3
File dataFile;
void setup(){
pinMode(SD_ChipSelectPin, OUTPUT);
pinMode(SPEAKER, OUTPUT);
tmrpcm.speakerPin = SPEAKER; //5,6,11 or 46 on Mega, 9 on Uno, Nano, etc
gb.begin();
Serial.begin(9600);
if (!SD.begin(SD_ChipSelectPin)) { // see if the card is present and can be initialized:
Serial.println("SD fail");
return; // don't do anything more if not
}else
{
Serial.println("SD Ok");
}
initGame(); // Titlescreen
}
void initGame(){
gb.titleScreen(F("Quosa's Spacedelivery"));
//gb.popup(F("Game is not Saved!"), 100);
}
void loop(){
if(gb.update()){
if(gb.buttons.pressed(BTN_A)){
tmrpcm.play("2.wav");}
}
}