Hello!
I have a problem with my arduino alarm clock(NOTE: it has no lcd). When I upload the code below, I get this error:
/usr/share/arduino/libraries/Time/DateStrings.cpp:41:22: error: variable ‘monthNames_P’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
/usr/share/arduino/libraries/Time/DateStrings.cpp:58:20: error: variable ‘dayNames_P’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
/usr/share/arduino/libraries/Time/DateStrings.cpp:59:24: error: variable ‘dayShortNames_P’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
#include <Time.h>
#include <TimeAlarms.h>
int Speaker = 9;
void setup()
{
Serial.begin(9600);
setTime(8,29,0,1,1,11);
Alarm.alarmRepeat(8,30,0, MorningAlarm);
pinMode(Speaker, OUTPUT);
}
void loop(){
Alarm.delay(1000);
}
void MorningAlarm(){
tone(Speaker,400,200);
delay(500);
tone(Speaker,400,200);
delay(500);
tone(Speaker,450,225);
delay(300);
tone(Speaker,450,225);
delay(500);
tone(Speaker,400,200);
delay(500);
tone(Speaker,450,200);
delay(300);
tone(Speaker,600,300);
delay(300);
tone(Speaker,400,200);
delay(500);
tone(Speaker,700,300);
delay(300);
tone(Speaker,700,300);
delay(500);
tone(Speaker,600,300);
delay(300);
tone(Speaker,400,200);
delay(1000);
tone(Speaker,400,200);
delay(500);
tone(Speaker,650,200);
delay(500);
tone(Speaker,400,200);
delay(500);
tone(Speaker,650,200);
delay(300);
tone(Speaker,650,200);
delay(500);
tone(Speaker,400,200);
delay(500);
tone(Speaker,400,200);
delay(500);
tone(Speaker,400,200);
delay(1000);
tone(Speaker,400,200);
delay(500);
tone(Speaker,400,200);
delay(500);
tone(Speaker,600,300);
delay(500);
tone(Speaker,600,300);
delay(500);
tone(Speaker,800,300);
delay(500);
tone(Speaker,800,300);
delay(500);
tone(Speaker,400,200);
}
Hardware: Arduino uno
DS1302 RTC module
Piezo speaker
The song that I play in it, I don't know what it is called because I got it from an other forum and it did not say what the song was.
If I am doing anything wrong, please tell me so I could know how to fix it.