Update 'Feather-M4-Express_NeoTrellis_Music-Maker-FeatherWing-w-Amp.ino'

This commit is contained in:
Danny Bessems 2019-08-16 10:52:53 +00:00
parent 880b621c14
commit 2e2e729545
1 changed files with 7 additions and 32 deletions

View File

@ -91,7 +91,6 @@ static struct ripple ripples[MAX_RIPPLES];
//define a callback for key presses
TrellisCallback blink(keyEvent evt){
for(int i=0; i<MAX_RIPPLES; i++){
if(ripples[i].center == -1){
//create a new ripple here
@ -116,25 +115,17 @@ Adafruit_VS1053_FilePlayer musicPlayer =
void setup() {
Serial.begin(115200);
// Wait for serial port to be opened, remove this line for 'standalone' operation
while (!Serial) { delay(1); }
/* delay(500);
*/
if (! musicPlayer.begin()) { // initialise the music player
Serial.println(F("Couldn't find VS1053, do you have the right pins defined?"));
while (1);
// Check availability of hardwarecomponents
if (!musicPlayer.begin() or !SD.begin(SD_CARDCS) or !trellis.begin()) {
Serial.println(F("Failed to initialize all hardwarecomponents (VS1053, Trellis or SD card)"));
while(1);
}
/*
// Leaving this here for reference purposes
musicPlayer.sineTest(0x44, 500);
*/
if (!SD.begin(SD_CARDCS)) {
Serial.println(F("SD failed, or not present"));
while (1); // don't do anything more
}
// Set volume for left, right channels. lower numbers == louder volume!
musicPlayer.setVolume(25,25);
musicPlayer.useInterrupt(VS1053_FILEPLAYER_PIN_INT); // DREQ int
@ -144,14 +135,6 @@ void setup() {
pinMode(NT_INTERRUPT, INPUT);
randomSeed(analogRead(0));
if(!trellis.begin()){
Serial.println("could not start trellis");
while(1);
}
else{
Serial.println("trellis started");
}
for(int i=0; i<MAX_RIPPLES; i++)
ripples[i].center = -1;
@ -176,15 +159,7 @@ void setup() {
}
void loop() {
Serial.print(".");
// File is playing in the background
/* if (musicPlayer.stopped()) {
Serial.println("Done playing music");
while (1) {
delay(10); // we're done! do nothing...
}
}
*/ if (Serial.available()) {
if (Serial.available()) {
char c = Serial.read();
// if we get an 's' on the serial console, stop!