RTClibExtended query



  • Wondering if someone can enlighten me on the use of FabioCuomo's RTClibExtended library for the DS3231... I have enough headaches trying to fathom Arduino, my understanding of RTCs is like a black art on top..
    I have a 3.3v 16MHz Arduino node with onboard DS3231m and radio module. The objective was to have the RTC wake the Node via INT1 every hour at xx.55 to initiate measurements and go back to sleep. It got WAY more complicated than first thought, as ended up with one 5v Arduino doing the measurements and passing it to the 3v over I2C, another learning curve which was "interesting"...😣
    After several fumbles trying to use different libraries and examples, I stumbled across this particular library and the wakeup_alarm example, which appeared functionally to offered a good solution.
    However, in wakeup_alarm, the routine had 3 distinct calls ending with the RTC.alarmInterrupt, then setting an AlarmFlag byte which sent the routine via a conditional statement into an endless loop, like a one shot alarm.
    I understand the purpose of setting RTC.alarmInterrupt back to true prior to going back to sleep, but the armAlarm and clearAlarm calls seem contradictory where the alarm is intended as repetitive, unless the alarm time declaration is to be made again and these two set back to true prior to sleep...

    //First clear the alarm
        RTC.begin();
        RTC.armAlarm(1, false);
        RTC.clearAlarm(1);
        RTC.alarmInterrupt(1, false);
      }  // end of loop```

  • Mod

    Is there a particular reason to take the measurements at that specific time?



  • @gohan Nope, hourly measurement is quite sufficient.
    I had bought two of these with onboard RTC to pass time control to the DS3231M and let the Nodes sleep, at the time it was purportedly energy advantageous.
    I'm aware I could have used a non-RTC version and a sleep time, although have yet to succesfully make sleep for an hour for some reason, yet 30 minutes is no problem.
    Just puzzled how it should be deployed, hence the query..


Log in to reply
 

Suggested Topics

  • 4
  • 8
  • 17
  • 9
  • 15
  • 9

35
Online

11.4k
Users

11.1k
Topics

112.7k
Posts