Модуль читает показания времени и отправляет показания на дисплей
C++
void timeUPD()
{ // Отправляем М:Ч:С с RTC модуля на дисплей
if (millis() - Timer1 >= period_time)
{ // Таймер отправки данных с датчика RTC в дисплей
void_temp_alarm();
guard();
if (choice_tel_01 == 1 || choice_tel_02 == 1 || choice_tel_03 == 1 || choice_tel_04 == 1)
{
countdown_autosms_send();
}
rtc.DSread();
if (averageCO > 500 && !count_co)
{
void_CO_alarm();
}
else if (averageCO < 200 && count_co)
{
count_co = false;
AudioBuffer();
player_on = false;
audio.stopSong();
play_stop = false;
}
dwin_sec_v = (rtc.second);
dwin_sec[6] = highByte(dwin_sec_v);
dwin_sec[7] = lowByte(dwin_sec_v);
if (rtc.second == 0)
{
dwin_min_v = (rtc.minute);
dwin_min[6] = highByte(dwin_min_v);
dwin_min[7] = lowByte(dwin_min_v);
SerialDwin.write(dwin_min, 8);
if (rtc.second == 0 && rtc.minute == 0)
{
dwin_hour_v = (rtc.hour);
String hour_ampm = rtc.getHour(true);
if (dwin_hour_v >= 12 && ampm_flag)
{
SerialDwin.write(dwin_pm_on, 8);
}
if (dwin_hour_v <= 11 && ampm_flag)
{
SerialDwin.write(dwin_am_on, 8);
}
if (ampm_flag)
{
dwin_hour_v = hour_ampm.toInt();
}
dwin_hour[6] = highByte(dwin_hour_v);
dwin_hour[7] = lowByte(dwin_hour_v);
SerialDwin.write(dwin_hour, 8);
if (rtc.hour == 0 && rtc.minute == 0)
{
dateReset();
}
}
}
SerialDwin.write(dwin_sec, 8);
Timer1 = millis();
if (pir_icon_flag)
{
pir_icon();
alarm_sound = alarm_move ? false : alarm_sound; // Если alarm_sound = 1, то alarm_sound = 0
alarm2_sound = alarm2_move ? false : alarm2_sound;
}
}
}