@@ -101,8 +101,8 @@ Adafruit_VS1053_FilePlayer musicPlayer =
101
101
Adafruit_VS1053_FilePlayer (VS1053_RESET, VS1053_CS, VS1053_DCS, VS1053_DREQ, CARDCS);
102
102
103
103
104
- RTC_DS3231 rtc;
105
- // RTC_PCF8523 rtc; // RTC object
104
+ // RTC_DS3231 rtc;
105
+ RTC_PCF8523 rtc; // RTC object
106
106
DST_RTC dst_rtc; // DST object
107
107
108
108
// Do you live in a country or territory that observes Daylight Saving Time?
@@ -143,7 +143,7 @@ void setup() {
143
143
// Set volume for left, right channels. lower numbers == louder volume!
144
144
musicPlayer.setVolume (VOLUME, VOLUME);
145
145
146
- musicPlayer.sineTest (0x44 , 500 ); // Make a tone to indicate VS1053 is working
146
+ musicPlayer.sineTest (0x44 , 1000 ); // Make a tone to indicate VS1053 is working
147
147
148
148
if (!SD.begin (CARDCS)) {
149
149
Serial.println (F (" SD failed, or not present" ));
@@ -182,7 +182,7 @@ void setup() {
182
182
}
183
183
184
184
// set RTC time if needed
185
- // if (rtc.lostPower()) {
185
+ // if (rtc.lostPower()) { // if using DS3231
186
186
if (! rtc.initialized ()) {
187
187
Serial.println (" RTC lost power, lets set the time!" );
188
188
// following line sets the RTC to the date & time this sketch was compiled
@@ -202,11 +202,12 @@ void setup() {
202
202
void loop () {
203
203
// put your main code here, to run repeatedly:
204
204
205
+ DateTime theTime;
205
206
// check time
206
207
if (OBSERVE_DST == 1 ) {
207
- DateTime theTime = dst_rtc.calculateTime (rtc.now ()); // takes into account DST
208
+ theTime = dst_rtc.calculateTime (rtc.now ()); // takes into account DST
208
209
} else {
209
- DateTime theTime = rtc.now (); // use if you don't need DST
210
+ theTime = rtc.now (); // use if you don't need DST
210
211
}
211
212
212
213
printTheTime (theTime);
0 commit comments