RTC.setAlarm(ALM1_MATCH_HOURS, 33, 18, 0); //set your wake-up time here
是33秒18分钟零小时吗?

自述文件引用了它的Adafruit库。从那里,我找不到实际在哪里说setAlarm的参数。

  • adafruit.github.io/RTClib
  • adafruit.github.io/RTClib/html/class_r_t_c___d_s3231.html
  • github.com/adafruit/RTClib

  • 库(在草图中)如下:
    #include <Wire.h>
    #include <RTClibExtended.h>
    #include <LowPower.h>
    

    最佳答案

    看起来它也来自另一个库。我只是搜索了代码本身,发现了这个:https://github.com/JChristensen/DS3232RTC#alarm-methods

      RTC.setAlarm(ALM1_MATCH_SECONDS, 30, 00, 0, 0);   //set your wake-up time here:
      RTC.setAlarm(ALM2_MATCH_MINUTES, 0, 10, 0, 0);  //where "xx" is minutes
      // every 00 minutes past the hour;
      // if every minute is needed change MINUTES to SECONDS (only for ALM1)
      // matches seconds AND minutes when _MINUTES is used. Sequence of time:
      // first seconds, then minutes, hours, daydate
      // or: seconds (but enter 00, is ignored), minutes then hours, daydate for ALM2
      // zero's mean: always
      // example: Set alarm1 every day at 18:33
      // RTC.setAlarm(ALM1_MATCH_HOURS, 33, 18, 0);  set your wake-up time here
      // RTC.alarmInterrupt(1, true);
    

    因此,闹钟每天设置为18:33。
    RTC.setAlarm(ALM1_MATCH_HOURS, [minute], [hour], 0);

    10-05 18:35