Статус:
Offline
Реєстрація: 01.09.2006
Повідом.: 574
Реєстрація: 01.09.2006
Повідом.: 574
- 🟢 06:35 Відбій тривоги в м. Харків та Харківська територіальна громада.Слідкуйте за подальшими повідомленнями.#м_Харків_та_Харківська_територіальна_громада
- #121
Не совсем так, если я правильно понял:значит, что сигнал на выходе INT DS-a будет формироваться в 0 часов 0 минут 20 секунд, в 20 секунд первого ночи
То есть имеем два примера, где в одном случае ставим на время конкретного дня недели, во втором - на конкретную дату. Как поставить просто на конкретный час, не привязываясь к дню недели и дате - я не могу понятьsetAlarm(ALARM_TYPES_t alarmType, byte seconds, byte minutes, byte hours, byte daydate)
Description
Set an alarm time. Sets the alarm registers only. To cause the INT pin to be asserted on alarm match, use alarmInterrupt(). This method can set either Alarm 1 or Alarm 2, depending on the value of alarmType (use the ALARM_TYPES_t enumeration above). When setting Alarm 2, the seconds value must be supplied but is ignored, recommend using zero. (Alarm 2 has no seconds register.)
Syntax
ParametersHTML:RTC.setAlarm(alarmType, seconds, minutes, hours, dayOrDate);
alarmType: A value from the ALARM_TYPES_t enumeration, above. (ALARM_TYPES_t)
seconds: The seconds value to set the alarm to. (byte)
minutes: The minutes value to set the alarm to. (byte)
hours: The hours value to set the alarm to. (byte)
dayOrDate: The day of the week or the date of the month. For day of the week, use a value from the Time library timeDayOfWeek_t enumeration, i.e. dowSunday, dowMonday, dowTuesday, dowWednesday, dowThursday, dowFriday, dowSaturday. (byte)
Returns
None.
Example
//Set Alarm1 for 12:34:56 on Sunday
HTML:RTC.setAlarm(ALM1_MATCH_DAY, 56, 34, 12, dowSunday);
setAlarm(ALARM_TYPES_t alarmType, byte minutes, byte hours, byte daydate)
Description
Set an alarm time. Sets the alarm registers only. To cause the INT pin to be asserted on alarm match, use alarmInterrupt(). This method can set either Alarm 1 or Alarm 2, depending on the value of alarmType (use the ALARM_TYPES_t enumeration above). However, when using this method to set Alarm 1, the seconds value is set to zero. (Alarm 2 has no seconds register.)
Syntax
ParametersHTML:RTC.setAlarm(alarmType, minutes, hours, dayOrDate);
alarmType: A value from the ALARM_TYPES_t enumeration, above. (ALARM_TYPES_t)
minutes: The minutes value to set the alarm to. (byte)
hours: The hours value to set the alarm to. (byte)
dayOrDate: The day of the week or the date of the month. For day of the week, use a value from the Time library timeDayOfWeek_t enumeration, i.e. dowSunday, dowMonday, dowTuesday, dowWednesday, dowThursday, dowFriday, dowSaturday. (byte)
Returns
None.
Example
//Set Alarm2 for 12:34 on the 4th day of the month
HTML:RTC.setAlarm(ALM1_MATCH_DATE, 34, 12, 4);

"Прерывание" надо включить
Влепил такое:И обработать "прерывание"
HTML:
RTC.alarmInterrupt(ALARM_2, true); //Включение будильника
RTC.squareWave(SQWAVE_1024_HZ); //Задание частоты на SQW