hello friends i got a ( Low memory available, stability problems may occur. ) and the code doesnt work i didnt use serial print i use mp3.play
#include <SPI.h>
#include <SdFat.h>
#include <SdFatUtil.h>
#include <SFEMP3Shield.h>
#include <Wire.h> //include Wire.h library
#include "RTClib.h"
RTC_DS3231 rtc ;
SdFat sd;
SFEMP3Shield MP3player;
int x,h,m ;
void setup () {
pinMode(5, INPUT);
Serial.begin(9600); //Begin the Serial at 9600 Baud
//Print the message if RTC is not available
if (! rtc.begin()) {
Serial.println("Couldn't find RTC");
while (1);
}
//Setup of time if RTC lost power or time is not set
if (rtc.lostPower()) {
//Sets the code compilation time to RTC DS3231
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
}
//start the shield
sd.begin(SD_SEL, SPI_HALF_SPEED);
MP3player.begin();
}
void loop () {
x = digitalRead(5);
DateTime now = rtc.now();
h = now.hour() ;
m= now.minute() ;
if (x ==1 )
{
MP3player.playMP3 ("Tracksa.mp3") ;
if ( h==00 || h ==12)
{MP3player.playMP3("Track12");
MP3player.playMP3("Trackw");
}
else if (h ==1 || h==13 )
{MP3player.playMP3("Track1") ;
MP3player.playMP3("Trackw");
}
else if (h == 2 || h==14 )
{MP3player.playMP3("Track2");
MP3player.playMP3("Trackw");
}
else if ( h==3 || h==15 )
{MP3player.playMP3("Track3");
MP3player.playMP3("Trackw");
}
else if ( h ==4 || h==16 )
{ MP3player.playMP3("Track4");
MP3player.playMP3("Trackw");
}
else if ( h ==5 || h ==17 )
{ MP3player.playMP3("Track5");
MP3player.playMP3("Trackw");
}
else if ( h==6 || h==18 )
{MP3player.playMP3("Track6");
MP3player.playMP3("Trackw");
}
else if ( h == 7 || h== 19 )
{MP3player.playMP3("Track7");
MP3player.playMP3("Trackw");
}
else if ( h ==8 || h == 20)
{MP3player.playMP3("Track8");
MP3player.playMP3("Trackw");
}
else if ( h== 9 || h == 21 )
{MP3player.playMP3("Track9");
MP3player.playMP3("Trackw");
}
else if ( h ==10 || h ==22 )
{MP3player.playMP3("Track10");
MP3player.playMP3("Trackw");
}
else if ( h==11 || h == 23 )
{MP3player.playMP3("Track11");
MP3player.playMP3("Trackw");
}
switch (m)
{case 1 :
MP3player.playMP3("Track1.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 2 :
MP3player.playMP3("Track2.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 3 :
MP3player.playMP3("Track3.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 4 :
MP3player.playMP3("Track4.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 5 :
MP3player.playMP3("Track5.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 6 :
MP3player.playMP3("Track6.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 7:
MP3player.playMP3("Track7.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 8 :
MP3player.playMP3("Track8.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 9 :
MP3player.playMP3("Track9.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 10 :
MP3player.playMP3("Track10.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 11 :
MP3player.playMP3("Track11.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 12 :
MP3player.playMP3("Track12.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 13 :
MP3player.playMP3("Track13.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 14 :
MP3player.playMP3("Track14.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 15 :
MP3player.playMP3("Track15.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 16 :
MP3player.playMP3("Track16.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 17 :
MP3player.playMP3("Track17.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 18 :
MP3player.playMP3("Track18.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 19 :
MP3player.playMP3("Track19.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 20 :
MP3player.playMP3("Track20.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 21 :
MP3player.playMP3("Track21.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 22 :
MP3player.playMP3("Track22.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 23 :
MP3player.playMP3("Track23.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 24 :
MP3player.playMP3("Track24.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 25 :
MP3player.playMP3("Track25.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 26 :
MP3player.playMP3("Track26.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 27 :
MP3player.playMP3("Track27.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 28 :
MP3player.playMP3("Track28.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 29 :
MP3player.playMP3("Track29.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 30 :
MP3player.playMP3("Track30.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 31 :
MP3player.playMP3("Track31.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 32 :
MP3player.playMP3("Track32.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 33 :
MP3player.playMP3("Track33.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 34 :
MP3player.playMP3("Track34.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 35 :
MP3player.playMP3("Track35.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 36 :
MP3player.playMP3("Track36.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 37 :
MP3player.playMP3("Track37.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 38 :
MP3player.playMP3("Track38.mp3");
;
MP3player.playMP3("Trackmin.mp3");
break ;
case 39 :
MP3player.playMP3("Track39.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 40 :
MP3player.playMP3("Track40.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 41 :
MP3player.playMP3("Track41.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 42 :
MP3player.playMP3("Track42.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 43 :
MP3player.playMP3("Track43.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 44 :
MP3player.playMP3("Track44.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 45 :
MP3player.playMP3("Track45.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 46 :
MP3player.playMP3("Track46.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 47 :
MP3player.playMP3("Track47.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 48 :
MP3player.playMP3("Track48.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 49 :
MP3player.playMP3("Track49.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 50 :
MP3player.playMP3("Track50.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 51 :
MP3player.playMP3("Track51mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 52 :
MP3player.playMP3("Track52.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 53 :
MP3player.playMP3("Track53.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 54 :
MP3player.playMP3("Track54.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 55 :
MP3player.playMP3("Track55.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 56 :
MP3player.playMP3("Track56.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 57 :
MP3player.playMP3("Track57.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 58 :
MP3player.playMP3("Track58.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
case 59 :
MP3player.playMP3("Track59.mp3");
MP3player.playMP3("Trackmin.mp3");
break ;
}
}
}
the problem is the code uses 93% im using arduin uno any solution please ?