Update 'Feather-M4-Express_NeoTrellis_Music-Maker-FeatherWing-w-Amp.ino'
This commit is contained in:
parent
880b621c14
commit
2e2e729545
@ -91,7 +91,6 @@ static struct ripple ripples[MAX_RIPPLES];
|
|||||||
|
|
||||||
//define a callback for key presses
|
//define a callback for key presses
|
||||||
TrellisCallback blink(keyEvent evt){
|
TrellisCallback blink(keyEvent evt){
|
||||||
|
|
||||||
for(int i=0; i<MAX_RIPPLES; i++){
|
for(int i=0; i<MAX_RIPPLES; i++){
|
||||||
if(ripples[i].center == -1){
|
if(ripples[i].center == -1){
|
||||||
//create a new ripple here
|
//create a new ripple here
|
||||||
@ -116,13 +115,10 @@ Adafruit_VS1053_FilePlayer musicPlayer =
|
|||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
|
|
||||||
// Wait for serial port to be opened, remove this line for 'standalone' operation
|
// Check availability of hardwarecomponents
|
||||||
while (!Serial) { delay(1); }
|
if (!musicPlayer.begin() or !SD.begin(SD_CARDCS) or !trellis.begin()) {
|
||||||
/* delay(500);
|
Serial.println(F("Failed to initialize all hardwarecomponents (VS1053, Trellis or SD card)"));
|
||||||
*/
|
while(1);
|
||||||
if (! musicPlayer.begin()) { // initialise the music player
|
|
||||||
Serial.println(F("Couldn't find VS1053, do you have the right pins defined?"));
|
|
||||||
while (1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -130,11 +126,6 @@ void setup() {
|
|||||||
musicPlayer.sineTest(0x44, 500);
|
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!
|
// Set volume for left, right channels. lower numbers == louder volume!
|
||||||
musicPlayer.setVolume(25,25);
|
musicPlayer.setVolume(25,25);
|
||||||
musicPlayer.useInterrupt(VS1053_FILEPLAYER_PIN_INT); // DREQ int
|
musicPlayer.useInterrupt(VS1053_FILEPLAYER_PIN_INT); // DREQ int
|
||||||
@ -145,14 +136,6 @@ void setup() {
|
|||||||
pinMode(NT_INTERRUPT, INPUT);
|
pinMode(NT_INTERRUPT, INPUT);
|
||||||
randomSeed(analogRead(0));
|
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++)
|
for(int i=0; i<MAX_RIPPLES; i++)
|
||||||
ripples[i].center = -1;
|
ripples[i].center = -1;
|
||||||
|
|
||||||
@ -176,15 +159,7 @@ void setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
Serial.print(".");
|
if (Serial.available()) {
|
||||||
// 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()) {
|
|
||||||
char c = Serial.read();
|
char c = Serial.read();
|
||||||
|
|
||||||
// if we get an 's' on the serial console, stop!
|
// if we get an 's' on the serial console, stop!
|
||||||
|
Loading…
Reference in New Issue
Block a user