@@ -101,8 +101,8 @@ Adafruit_VS1053_FilePlayer musicPlayer =
101101 Adafruit_VS1053_FilePlayer (VS1053_RESET, VS1053_CS, VS1053_DCS, VS1053_DREQ, CARDCS);
102102
103103
104- RTC_DS3231 rtc;
105- // RTC_PCF8523 rtc; // RTC object
104+ // RTC_DS3231 rtc;
105+ RTC_PCF8523 rtc; // RTC object
106106DST_RTC dst_rtc; // DST object
107107
108108// Do you live in a country or territory that observes Daylight Saving Time?
@@ -143,7 +143,7 @@ void setup() {
143143 // Set volume for left, right channels. lower numbers == louder volume!
144144 musicPlayer.setVolume (VOLUME, VOLUME);
145145
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
147147
148148 if (!SD.begin (CARDCS)) {
149149 Serial.println (F (" SD failed, or not present" ));
@@ -182,7 +182,7 @@ void setup() {
182182 }
183183
184184 // set RTC time if needed
185- // if (rtc.lostPower()) {
185+ // if (rtc.lostPower()) { // if using DS3231
186186 if (! rtc.initialized ()) {
187187 Serial.println (" RTC lost power, lets set the time!" );
188188 // following line sets the RTC to the date & time this sketch was compiled
@@ -202,11 +202,12 @@ void setup() {
202202void loop () {
203203 // put your main code here, to run repeatedly:
204204
205+ DateTime theTime;
205206 // check time
206207 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
208209 } else {
209- DateTime theTime = rtc.now (); // use if you don't need DST
210+ theTime = rtc.now (); // use if you don't need DST
210211 }
211212
212213 printTheTime (theTime);
0 commit comments