<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[forum.rcl-radio.ru &mdash; Часы (DS3231) с будильником (Arduino)]]></title>
	<link rel="self" href="http://forum.rcl-radio.ru/extern.php?action=feed&amp;tid=129&amp;type=atom" />
	<updated>2025-12-04T06:08:18Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.rcl-radio.ru/viewtopic.php?id=129</id>
		<entry>
			<title type="html"><![CDATA[Re: Часы (DS3231) с будильником (Arduino)]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=11988#p11988" />
			<content type="html"><![CDATA[<p>Не знаю, прочитает ли кто-нибудь это, но меня просто распирает чувство признательности!<br />И восхищает терпение и работоспособность автора проекта Liman324.<br />У меня тут возникла задачка сделасть своему приятелю соседу по даче компактные часы с метеостанцией. Он рыболов и еему такое нужно. Сам я по образованию чистый радиотехник, в программировании очень слаб. И вот нахожу готовый проект. Проблема снята!<br />Вообще это уже третий проект автора Liman324, который я реализовал. Первый — аудиопроцесссор PT2314, потом FM-радио на RDA5807 c OLED дисплеем и теперь вот эти часики.<br />Спасибо огромное! Очень полезный сайт и форум, очень жалко будет, ессли этот ресурс зачахнет.</p>]]></content>
			<author>
				<name><![CDATA[Yuri_Blues]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=1056</uri>
			</author>
			<updated>2025-12-04T06:08:18Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=11988#p11988</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Часы (DS3231) с будильником (Arduino)]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=11764#p11764" />
			<content type="html"><![CDATA[<p>Выкладываю отлаженный код целиком</p><p>// <a href="http://forum.rcl-radio.ru/viewtopic.php?id=129&amp;p=7">http://forum.rcl-radio.ru/viewtopic.php?id=129&amp;p=7</a><br />#include &lt;Wire.h&gt;<br />#include &lt;LCD_1602_RUS.h&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// <a href="https://github.com/ssilver2007/LCD_1602_RUS">https://github.com/ssilver2007/LCD_1602_RUS</a><br />LCD_1602_RUS lcd(0x27,16,4);</p><p>&nbsp; #define SET&nbsp; &nbsp; 4<br />&nbsp; #define UP&nbsp; &nbsp; &nbsp;2<br />&nbsp; #define DW&nbsp; &nbsp; &nbsp;3<br />&nbsp; #define ALARM&nbsp; 5<br />&nbsp; #define BB&nbsp; &nbsp; &nbsp;6<br />&nbsp; #include &lt;EEPROM.h&gt;<br />&nbsp; #include &lt;DS3231.h&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// <a href="http://rcl-radio.ru/wp-content/uploads/2022/10/DS3231.zip">http://rcl-radio.ru/wp-content/uploads/ … DS3231.zip</a><br />&nbsp; #include &lt;Adafruit_BME280.h&gt;&nbsp; &nbsp; // <a href="https://github.com/adafruit/Adafruit_BME280_Library.git">https://github.com/adafruit/Adafruit_BME280_Library.git</a><br />&nbsp; DS3231 clock;<br />&nbsp; RTCDateTime DateTime;<br />&nbsp; Adafruit_BME280 bme;</p><p>&nbsp; int x = 0;<br />&nbsp; int y = 0;<br />&nbsp; int n2 = 0;<br />&nbsp; int m2 = 0;<br />&nbsp; int r3 = 0;<br />&nbsp; int r4 = 0;</p><p>&nbsp; int hour,minut,secon,year,month,day,den;<br />&nbsp; int svet;<br />&nbsp; float temp,p,h;<br />&nbsp; int set,hh,mm,ss,dd,mn,gg,&nbsp; hh_alarm,mm_alarm;<br />&nbsp; long times,times0,times1;<br />&nbsp; &nbsp;<br />&nbsp; int reg;<br />&nbsp; byte alarm_on;<br />&nbsp; bool alarm,tic;</p><p>&nbsp; byte customChar0[] = {B00000,B00000,B00000,B00000,B00000,B00000,B00000,B00000};<br />&nbsp; byte customChar1[] = {B01110,B11111,B11111,B11111,B11111,B11111,B11111,B01110};<br />&nbsp; byte customChar2[] = {B11111,B01110,B00000,B00000,B00000,B00000,B00000,B00000};<br />&nbsp; byte customChar3[] = {B00000,B00000,B00000,B00000,B00000,B00000,B01110,B11111};<br />&nbsp; byte customChar4[] = {B11111,B01110,B00000,B00000,B00000,B00000,B01110,B11111};<br />&nbsp; byte customChar5[] = {B00100,B01110,B01110,B01110,B11111,B11111,B00010,B00000}; // значок будильника<br />&nbsp; //byte customChar6[] = {B00000,B00000,B00001,B00011,B00011,B00001,B00000,B00000}; // двоеточие для больших часов<br />&nbsp; //byte customChar7[] = {B00000,B00000,B10000,B11000,B11000,B10000,B00000,B00000}; // двоеточие для больших часов<br />&nbsp; </p><p>void T1() { // Большие цифры для часов (на 2-3 строках)<br />&nbsp; n2 = hh;<br />&nbsp; m2 = mm;<br />&nbsp; NB1();<br />&nbsp; NB2();</p><p>&nbsp; /*// этот блок показывает двоеточие в часах<br />&nbsp; lcd.createChar(6, customChar6);lcd.setCursor(3, 2);lcd.write(6);<br />&nbsp; lcd.createChar(7, customChar7);lcd.setCursor(4, 2);lcd.write(7);<br />&nbsp; lcd.createChar(6, customChar6);lcd.setCursor(3, 3);lcd.write(6);<br />&nbsp; lcd.createChar(7, customChar7);lcd.setCursor(4, 3);lcd.write(7);<br />&nbsp; &nbsp;delay(250);<br />&nbsp; // этот блок затирает двоеточие в часах<br />&nbsp; lcd.createChar(0, customChar0);lcd.setCursor(3, 2);lcd.write(0);<br />&nbsp; lcd.createChar(0, customChar0);lcd.setCursor(4, 2);lcd.write(0);<br />&nbsp; lcd.createChar(0, customChar0);lcd.setCursor(3, 3);lcd.write(0);<br />&nbsp; lcd.createChar(0, customChar0);lcd.setCursor(4, 3);lcd.write(0);<br />&nbsp; &nbsp;delay(250);*/<br />}</p><p>void n3() {<br />&nbsp; if (y == 0) {x0();}<br />&nbsp; if (y == 1) {x1();}<br />&nbsp; if (y == 2) {x2();}<br />&nbsp; if (y == 3) {x3();}<br />&nbsp; if (y == 4) {x4();}<br />&nbsp; if (y == 5) {x5();}<br />&nbsp; if (y == 6) {x6();}<br />&nbsp; if (y == 7) {x7();}<br />&nbsp; if (y == 8) {x8();}<br />&nbsp; if (y == 9) {x9();}<br />&nbsp; if (y == 10) {x10();}<br />}</p><p>void x0() {<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor(x, 2);lcd.write(1);<br />&nbsp; lcd.createChar(2, customChar2);lcd.setCursor((x + 1), 2);lcd.write(2);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor((x + 2), 2);lcd.write(1);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor(x, 3);lcd.write(1);<br />&nbsp; lcd.createChar(3, customChar3);lcd.setCursor((x + 1), 3);lcd.write(3);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor((x + 2), 3);lcd.write(1);<br />&nbsp; }<br />void x1() {<br />&nbsp; lcd.createChar(2, customChar2);lcd.setCursor(x, 2);lcd.write(2);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor((x + 1), 2);lcd.write(1);<br />&nbsp; lcd.createChar(0, customChar0);lcd.setCursor((x + 2), 2);lcd.write(0);<br />&nbsp; lcd.createChar(3, customChar3);lcd.setCursor(x, 3);lcd.write(3);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor((x + 1), 3);lcd.write(1);<br />&nbsp; lcd.createChar(3, customChar3);lcd.setCursor((x + 2), 3);lcd.write(3);<br />&nbsp; }<br />void x2() {<br />&nbsp; lcd.createChar(2, customChar2);lcd.setCursor(x, 2);lcd.write(2);<br />&nbsp; lcd.createChar(4, customChar4);lcd.setCursor((x + 1), 2);lcd.write(4);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor((x + 2), 2);lcd.write(1);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor(x, 3);lcd.write(1);<br />&nbsp; lcd.createChar(3, customChar3);lcd.setCursor((x + 1), 3);lcd.write(3);<br />&nbsp; lcd.createChar(3, customChar3);lcd.setCursor((x + 2), 3);lcd.write(3);<br />&nbsp; }<br />void x3() {<br />&nbsp; lcd.createChar(2, customChar2);lcd.setCursor(x, 2);lcd.write(2);<br />&nbsp; lcd.createChar(4, customChar4);lcd.setCursor((x + 1), 2);lcd.write(4);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor((x + 2), 2);lcd.write(1);<br />&nbsp; lcd.createChar(3, customChar3);lcd.setCursor(x, 3);lcd.write(3);<br />&nbsp; lcd.createChar(3, customChar3);lcd.setCursor((x + 1), 3);lcd.write(3);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor((x + 2), 3);lcd.write(1);<br />&nbsp; }<br />void x4() {<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor(x, 2);lcd.write(1);<br />&nbsp; lcd.createChar(3, customChar3);lcd.setCursor((x + 1), 2);lcd.write(3);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor((x + 2), 2);lcd.write(1);<br />&nbsp; lcd.createChar(0, customChar0);lcd.setCursor(x, 3);lcd.write(0);<br />&nbsp; lcd.createChar(0, customChar0);lcd.setCursor((x + 1), 3);lcd.write(0);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor((x + 2), 3);lcd.write(1);<br />&nbsp; }<br />void x5() {<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor(x, 2);lcd.write(1);<br />&nbsp; lcd.createChar(4, customChar4);lcd.setCursor((x + 1), 2);lcd.write(4);<br />&nbsp; lcd.createChar(2, customChar2);lcd.setCursor((x + 2), 2);lcd.write(2);<br />&nbsp; lcd.createChar(3, customChar3);lcd.setCursor(x, 3);lcd.write(3);<br />&nbsp; lcd.createChar(3, customChar3);lcd.setCursor((x + 1), 3);lcd.write(3);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor((x + 2), 3);lcd.write(1);<br />&nbsp; }<br />void x6() {<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor(x, 2);lcd.write(1);<br />&nbsp; lcd.createChar(4, customChar4);lcd.setCursor((x + 1), 2);lcd.write(4);<br />&nbsp; lcd.createChar(2, customChar2);lcd.setCursor((x + 2), 2);lcd.write(2);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor(x, 3);lcd.write(1);<br />&nbsp; lcd.createChar(3, customChar3);lcd.setCursor((x + 1), 3);lcd.write(3);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor((x + 2), 3);lcd.write(1);<br />&nbsp; }<br />void x7() {<br />&nbsp; lcd.createChar(2, customChar2);lcd.setCursor(x, 2);lcd.write(2);<br />&nbsp; lcd.createChar(2, customChar2);lcd.setCursor((x + 1), 2);lcd.write(2);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor((x + 2), 2);lcd.write(1);<br />&nbsp; lcd.createChar(0, customChar0);lcd.setCursor(x, 3);lcd.write(0);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor((x + 1), 3);lcd.write(1);<br />&nbsp; lcd.createChar(0, customChar0);lcd.setCursor((x + 2), 3);lcd.write(0);<br />&nbsp; }<br />void x8() {<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor(x, 2);lcd.write(1);<br />&nbsp; lcd.createChar(4, customChar4);lcd.setCursor((x + 1), 2);lcd.write(4);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor((x + 2), 2);lcd.write(1);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor(x, 3);lcd.write(1);<br />&nbsp; lcd.createChar(3, customChar3);lcd.setCursor((x + 1), 3);lcd.write(3);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor((x + 2), 3);lcd.write(1);<br />&nbsp; }<br />void x9() {<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor(x, 2);lcd.write(1);<br />&nbsp; lcd.createChar(4, customChar4);lcd.setCursor((x + 1), 2);lcd.write(4);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor((x + 2), 2);lcd.write(1);<br />&nbsp; lcd.createChar(3, customChar3);lcd.setCursor(x, 3);lcd.write(3);<br />&nbsp; lcd.createChar(3, customChar3);lcd.setCursor((x + 1), 3);lcd.write(3);<br />&nbsp; lcd.createChar(1, customChar1);lcd.setCursor((x + 2), 3);lcd.write(1);<br />&nbsp; }<br />void x10() {<br />&nbsp; lcd.createChar(0, customChar0);lcd.setCursor(x, 2);lcd.write(0);<br />&nbsp; lcd.createChar(0, customChar0);lcd.setCursor((x + 1), 2);lcd.write(0);<br />&nbsp; lcd.createChar(0, customChar0);lcd.setCursor((x + 2), 2);lcd.write(0);<br />&nbsp; lcd.createChar(0, customChar0);lcd.setCursor(x, 3);lcd.write(0);<br />&nbsp; lcd.createChar(0, customChar0);lcd.setCursor((x + 1), 3);lcd.write(0);<br />&nbsp; lcd.createChar(0, customChar0);lcd.setCursor((x + 2), 3);lcd.write(0);<br />&nbsp; }</p><p>void NB1() {<br />&nbsp; if (n2 &gt;= 10 &amp; n2 &lt; 100) {x = -4; r3 = n2 / 10; y = r3; n3(); x = 0; r4 = n2 - r3 * 10; y = r4; n3();}<br />&nbsp; if (n2 &gt;= 0 &amp; n2 &lt; 10) {x = -4; y = 10; n3(); x = 0; r4 = n2; y = r4; n3();}<br />&nbsp; }<br />void NB2() {<br />&nbsp; if (m2 &gt;= 10 &amp; m2 &lt; 100) {x = 5; r3 = m2 / 10; y = r3; n3(); x = 9; r4 = m2 - r3 * 10; y = r4; n3();}<br />&nbsp; if (m2 &gt;= 0 &amp; m2 &lt; 10) {x = 5; y = 0; n3(); x = 9; r4 = m2; y = r4; n3();}<br />&nbsp; }<br />void NB3() {<br />&nbsp; if (n2 &gt;= 10 &amp; n2 &lt; 100) {x = -4; r3 = n2 / 10; y = r3; n3(); x = 0; r4 = n2 - r3 * 10; y = r4; n3();}<br />&nbsp; if (n2 &gt;= 0 &amp; n2 &lt; 10) {x = -4; y = 10; n3(); x = 0; r4 = n2; y = r4; n3();}<br />&nbsp; }<br />void NB4() {<br />&nbsp; if (m2 &gt;= 10 &amp; m2 &lt; 100) {x = 5; r3 = m2 / 10; y = r3; n3(); x = 9; r4 = m2 - r3 * 10; y = r4; n3();}<br />&nbsp; if (m2 &gt;= 0 &amp; m2 &lt; 10) {x = 5; y = 0; n3(); x = 9; r4 = m2; y = r4; n3();}<br />&nbsp; }</p><br /><p>void setup() {<br />//Serial.begin(9600);<br />lcd.init();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // инициализация lcd <br />lcd.backlight();<br />&nbsp; &nbsp;<br />&nbsp; pinMode(10,OUTPUT); // LCD1602_LED<br />&nbsp; pinMode(9,OUTPUT);&nbsp; // BUZZER<br />&nbsp; pinMode(8,OUTPUT);&nbsp; // LED (инд. будильника)</p><p>&nbsp; analogWrite(10, 250); //управление яркостью подсветки LCD, 10-пин на который подключена подсветка LCD, 250-подаваемое напряжение (мах - 255-5В)<br />&nbsp; clock.begin();<br />&nbsp; bme.begin(0x76);</p><p>&nbsp; pinMode(A2,INPUT);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// вход фоторезистора<br />&nbsp; pinMode(12,INPUT);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// сенсорная кнопка будильника (в режиме тактовой кнопки)<br />&nbsp; pinMode(11,INPUT);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// сенсорная кнопка LED LCD (в режиме переключателя)<br />&nbsp; pinMode(SET,INPUT_PULLUP);&nbsp; &nbsp;// SET (сброс) - кнопка<br />&nbsp; pinMode(UP,INPUT_PULLUP);&nbsp; &nbsp; // UP (час+) - кнопка<br />&nbsp; pinMode(DW,INPUT_PULLUP);&nbsp; &nbsp; // DW (мин-) - кнопка<br />&nbsp; pinMode(ALARM,INPUT_PULLUP); // ВКЛ/ОТК БУД. (сигнал) - тумблер<br />&nbsp; pinMode(BB,INPUT_PULLUP);&nbsp; &nbsp; // ВКЛ/ОТК больших цифр часов - тумблер</p><p>&nbsp; //clock.setDateTime(__DATE__, __TIME__); //установка времени с ПК (во время прошивки)</p><p>&nbsp; hh_alarm = EEPROM.read(0);mm_alarm = EEPROM.read(1);<br />}</p><p>void loop() {<br />&nbsp; &nbsp; if(digitalRead(11)==HIGH){<br />&nbsp; &nbsp; if(millis()-times0&gt;1000){ //время реакции фоторезистора на свет<br />&nbsp; &nbsp; svet = map(analogRead(A2), 0,250,10,250);if(svet&gt;250){svet=250;}<br />&nbsp; &nbsp; analogWrite(10, svet);<br />&nbsp; &nbsp; times0=millis();<br />&nbsp; &nbsp; }}else{analogWrite(10, 0);}<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; DateTime = clock.getDateTime();<br />&nbsp; &nbsp; hour = DateTime.hour;<br />&nbsp; &nbsp; minut = DateTime.minute;<br />&nbsp; &nbsp; secon = DateTime.second;<br />&nbsp; &nbsp; year=DateTime.year;<br />&nbsp; &nbsp; month=DateTime.month;<br />&nbsp; &nbsp; day=DateTime.day;<br />&nbsp; &nbsp; den=DateTime.dayOfWeek;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; hh=hour;mm=minut;ss=secon;dd=day;mn=month;gg=year;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; temp = bme.readTemperature();<br />&nbsp; &nbsp; p = bme.readPressure() / 133.3224;<br />&nbsp; &nbsp; h = bme.readHumidity();<br />&nbsp; &nbsp; // этот блок выводит в монитор порта данные<br />&nbsp; &nbsp; /*Serial.print(hour/10);Serial.print(hour%10);Serial.print(&quot;:&quot;);<br />&nbsp; &nbsp; Serial.print(minut/10);Serial.print(minut%10);Serial.print(&quot;:&quot;);<br />&nbsp; &nbsp; Serial.print(secon/10);Serial.println(secon%10);<br />&nbsp; &nbsp; Serial.println(temp,1);<br />&nbsp; &nbsp; Serial.println(p,1);<br />&nbsp; &nbsp; Serial.println(h,1);<br />&nbsp; &nbsp; Serial.println(svet);<br />&nbsp; &nbsp; Serial.print(&quot;D5 = &quot;);Serial.println(digitalRead(5));<br />&nbsp; &nbsp; Serial.print(&quot;D6 = &quot;);Serial.println(digitalRead(6));<br />&nbsp; &nbsp; Serial.print(&quot;D7 = &quot;);Serial.println(digitalRead(7));<br />&nbsp; &nbsp; Serial.print(&quot;D11 = &quot;);Serial.println(digitalRead(11));<br />&nbsp; &nbsp; Serial.print(&quot;D12 = &quot;);Serial.println(digitalRead(12));*/</p><p>&nbsp; &nbsp; if(digitalRead(BB)==LOW &amp;&amp; reg==0){reg=8;delay(200);lcd.clear();}<br />&nbsp; &nbsp; if(digitalRead(SET)==LOW &amp;&amp; reg==0){reg=1;delay(200);lcd.clear();}<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; if(reg==1){<br />&nbsp; &nbsp; lcd.setCursor(2, 0);<br />&nbsp; &nbsp; lcd.print(&quot;Настроика&quot;);<br />&nbsp; &nbsp; lcd.setCursor(0, 1);<br />&nbsp; &nbsp; lcd.print(&quot;&gt; будильника&quot;);<br />&nbsp; &nbsp; if(digitalRead(UP)==LOW){reg = 2;delay(200);lcd.clear();}<br />&nbsp; &nbsp; if(digitalRead(DW)==LOW){reg = 2;delay(200);lcd.clear();}<br />&nbsp; &nbsp; if(digitalRead(SET)==LOW){reg = 3;delay(200);lcd.clear();}<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; if(reg==2){<br />&nbsp; &nbsp; lcd.setCursor(2, 0);<br />&nbsp; &nbsp; lcd.print(&quot;Настроика&quot;);<br />&nbsp; &nbsp; lcd.setCursor(0, 1);<br />&nbsp; &nbsp; lcd.print(&quot;&gt; часов и даты&quot;);<br />&nbsp; &nbsp; if(digitalRead(UP)==LOW){reg = 1;delay(200);lcd.clear();}<br />&nbsp; &nbsp; if(digitalRead(DW)==LOW){reg = 1;delay(200);lcd.clear();}<br />&nbsp; &nbsp; if(digitalRead(SET)==LOW){reg = 4;delay(200);lcd.clear();} //D4<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; if(reg==3){ // подменю - настройки времени будильника<br />&nbsp; &nbsp; if(digitalRead(SET)==LOW){set++;if(set&gt;2){set=0;}delay(200);}<br />&nbsp; &nbsp; if(set==1 &amp;&amp; digitalRead(UP)==LOW){hh_alarm++;if(hh_alarm&gt;23){hh_alarm=0;}delay(200);}<br />&nbsp; &nbsp; if(set==1 &amp;&amp; digitalRead(DW)==LOW){hh_alarm--;if(hh_alarm&lt;0){hh_alarm=0;}delay(200);}<br />&nbsp; &nbsp; if(set==2 &amp;&amp; digitalRead(UP)==LOW){mm_alarm++;if(mm_alarm&gt;59){mm_alarm=0;}delay(200);}<br />&nbsp; &nbsp; if(set==2 &amp;&amp; digitalRead(DW)==LOW){mm_alarm--;if(mm_alarm&lt;0){mm_alarm=0;}delay(200);}<br />&nbsp; &nbsp; lcd.setCursor(0, 0);lcd.print(&quot;Будильник&quot;);<br />&nbsp; &nbsp; lcd.setCursor(0, 1);<br />&nbsp; &nbsp; if(set==1&amp;&amp;millis()-times&lt;200){lcd.print(&quot;&nbsp; &quot;);}else{lcd.print(hh_alarm/10%10);lcd.print(hh_alarm%10);}lcd.print(&quot;:&quot;);<br />&nbsp; &nbsp; if(set==2&amp;&amp;millis()-times&lt;200){lcd.print(&quot;&nbsp; &quot;);}else{lcd.print(mm_alarm/10%10);lcd.print(mm_alarm%10);}lcd.print(&quot; &quot;);</p><p>&nbsp; &nbsp; if(set==0&amp;&amp;(digitalRead(UP)==LOW || digitalRead(DW)==LOW)){reg=0;set=0;lcd.clear();delay(200);EEPROM.update(0,hh_alarm);EEPROM.update(1,mm_alarm);}<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; if(reg==4){ // подменю - руч.настройки времени и даты<br />&nbsp; &nbsp; if(digitalRead(SET)==LOW){set++;if(set&gt;5){set=0;}delay(200);}<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; if(set==1 &amp;&amp; digitalRead(UP)==LOW){hh++;if(hh&gt;23){hh=0;}clock.setDateTime(gg, mn, dd, hh, mm, ss);delay(200);}<br />&nbsp; &nbsp; if(set==1 &amp;&amp; digitalRead(DW)==LOW){hh--;if(hh&lt;0){hh=0;}clock.setDateTime(gg, mn, dd, hh, mm, ss);delay(200);}<br />&nbsp; &nbsp; if(set==2 &amp;&amp; digitalRead(UP)==LOW){mm++;if(mm&gt;59){mm=0;}clock.setDateTime(gg, mn, dd, hh, mm, ss);delay(200);}<br />&nbsp; &nbsp; if(set==2 &amp;&amp; digitalRead(DW)==LOW){mm--;if(mm&lt;0){mm=0;}clock.setDateTime(gg, mn, dd, hh, mm, ss);delay(200);}<br />&nbsp; &nbsp; if(set==3 &amp;&amp; digitalRead(UP)==LOW){dd++;if(dd&gt;31){dd=1;}clock.setDateTime(gg, mn, dd, hh, mm, ss);delay(200);}<br />&nbsp; &nbsp; if(set==3 &amp;&amp; digitalRead(DW)==LOW){dd--;if(dd&lt;1){dd=1;}clock.setDateTime(gg, mn, dd, hh, mm, ss);delay(200);}<br />&nbsp; &nbsp; if(set==4 &amp;&amp; digitalRead(UP)==LOW){mn++;if(mn&gt;12){mn=1;}clock.setDateTime(gg, mn, dd, hh, mm, ss);delay(200);}<br />&nbsp; &nbsp; if(set==4 &amp;&amp; digitalRead(DW)==LOW){mn--;if(mn&lt;1){mn=1;}clock.setDateTime(gg, mn, dd, hh, mm, ss);delay(200);}<br />&nbsp; &nbsp; if(set==5 &amp;&amp; digitalRead(UP)==LOW){gg++;if(gg&gt;2099){gg=2099;}clock.setDateTime(gg, mn, dd, hh, mm, ss);delay(200);}<br />&nbsp; &nbsp; if(set==5 &amp;&amp; digitalRead(DW)==LOW){gg--;if(gg&lt;2025){gg=2025;}clock.setDateTime(gg, mn, dd, hh, mm, ss);delay(200);}<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; lcd.setCursor(0, 0);lcd.print(&quot;Время и дата&quot;);<br />&nbsp; &nbsp; lcd.setCursor(0, 1);<br />&nbsp; &nbsp; if(set==1&amp;&amp;millis()-times&lt;200){lcd.print(&quot;&nbsp; &quot;);}else{lcd.print(hour/10%10);lcd.print(hour%10);}lcd.print(&quot;:&quot;);<br />&nbsp; &nbsp; if(set==2&amp;&amp;millis()-times&lt;200){lcd.print(&quot;&nbsp; &quot;);}else{lcd.print(minut/10%10);lcd.print(minut%10);}lcd.print(&quot; &quot;);<br />&nbsp; &nbsp; if(set==3&amp;&amp;millis()-times&lt;200){lcd.print(&quot;&nbsp; &quot;);}else{lcd.print(day/10%10);lcd.print(day%10);}lcd.print(&quot;.&quot;);<br />&nbsp; &nbsp; if(set==4&amp;&amp;millis()-times&lt;200){lcd.print(&quot;&nbsp; &quot;);}else{lcd.print(month/10%10);lcd.print(month%10);}lcd.print(&quot;.&quot;);<br />&nbsp; &nbsp; if(set==5&amp;&amp;millis()-times&lt;200){lcd.print(&quot;&nbsp; &nbsp; &quot;);}else{lcd.print(year);}<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; if(set==0&amp;&amp;(digitalRead(UP)==LOW || digitalRead(DW)==LOW)){reg=0;set=0;lcd.clear();delay(200);}<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; // блок главного экрана<br />&nbsp; &nbsp; if(reg==0){<br />&nbsp; &nbsp; if(millis()-times1&lt;500){tic=1;}else{tic=0;}if(millis()-times1&gt;1000){times1=millis();}</p><p>&nbsp; &nbsp; lcd.setCursor(0, 0);// расположение строки со значениями BME280 <br />&nbsp; &nbsp; lcd.print(temp,1);lcd.print((char)223);lcd.print(&quot;C &quot;);<br />&nbsp; &nbsp; lcd.print(h,0);lcd.print(&quot;% &quot;);<br />&nbsp; &nbsp; lcd.print(p,0);lcd.print(&quot;mH&quot;);&nbsp; &nbsp;</p><p>&nbsp; &nbsp; lcd.setCursor(3, 1);// расположение даты<br />&nbsp; &nbsp; if(set==3&amp;&amp;millis()-times&lt;200){lcd.print(&quot;&nbsp; &quot;);}else{lcd.print(day/10%10);lcd.print(day%10);}lcd.print(&quot;.&quot;);<br />&nbsp; &nbsp; if(set==4&amp;&amp;millis()-times&lt;200){lcd.print(&quot;&nbsp; &quot;);}else{lcd.print(month/10%10);lcd.print(month%10);}lcd.print(&quot;.&quot;);<br />&nbsp; &nbsp; if(set==5&amp;&amp;millis()-times&lt;200){lcd.print(&quot;&nbsp; &nbsp; &quot;);}else{lcd.print(year);}</p><p>&nbsp; &nbsp; // расположение значка будильник<br />&nbsp; &nbsp; if(digitalRead(ALARM)==LOW){lcd.createChar(5, customChar5);lcd.setCursor(14, 1);lcd.write(5);}else{lcd.createChar(0, customChar0);lcd.setCursor(14, 1);lcd.write(0);}</p><p>&nbsp; &nbsp; lcd.setCursor(3, 2); // расположение дня недели<br />&nbsp; &nbsp; switch(den){<br />&nbsp; &nbsp; case 1: lcd.print(&quot;Mo&quot;);break;<br />&nbsp; &nbsp; case 2: lcd.print(&quot;Tu&quot;);break;<br />&nbsp; &nbsp; case 3: lcd.print(&quot;We&quot;);break;<br />&nbsp; &nbsp; case 4: lcd.print(&quot;Th&quot;);break;<br />&nbsp; &nbsp; case 5: lcd.print(&quot;Fr&quot;);break;<br />&nbsp; &nbsp; case 6: lcd.print(&quot;Sa&quot;);break;<br />&nbsp; &nbsp; case 7: lcd.print(&quot;Su&quot;);break;<br />&nbsp; &nbsp; /*case 1: lcd.print(&quot;ПН&quot;);break; // с большими цифрами русские буквы не отображаются :-(( !!!<br />&nbsp; &nbsp; case 2: lcd.print(&quot;BT&quot;);break;<br />&nbsp; &nbsp; case 3: lcd.print(&quot;CP&quot;);break;<br />&nbsp; &nbsp; case 4: lcd.print(&quot;ЧТ&quot;);break;<br />&nbsp; &nbsp; case 5: lcd.print(&quot;ПТ&quot;);break;<br />&nbsp; &nbsp; case 6: lcd.print(&quot;CБ&quot;);break;<br />&nbsp; &nbsp; case 7: lcd.print(&quot;BC&quot;);break;*/<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; T1(); //большие цифры часов<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; lcd.setCursor(3, 3); // расположение часов<br />&nbsp; &nbsp; //if(set==1&amp;&amp;millis()-times&lt;200){lcd.print(&quot;&nbsp; &quot;);}else{lcd.print(hour/10%10);lcd.print(hour%10);}if(tic==1){lcd.print(&quot;:&quot;);}else{lcd.print(&quot; &quot;);}<br />&nbsp; &nbsp; //if(set==2&amp;&amp;millis()-times&lt;200){lcd.print(&quot;&nbsp; &quot;);}else{lcd.print(minut/10%10);lcd.print(minut%10);}<br />&nbsp; &nbsp; if(set==2&amp;&amp;millis()-times&lt;200){lcd.print(&quot;&nbsp; &quot;);}else{lcd.print(secon/10%10);lcd.print(secon%10);}<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; if(millis()-times&gt;400){times=millis();}<br />&nbsp; &nbsp; if(digitalRead(ALARM)==LOW){digitalWrite(8,HIGH);alarm = 1;}else{digitalWrite(8,LOW);alarm = 0;}<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(hh_alarm*100+mm_alarm!=hour*100+minut){alarm_on=0;}<br />&nbsp; &nbsp; if(hh_alarm*100+mm_alarm==hour*100+minut &amp;&amp; alarm==1 &amp;&amp; alarm_on==0){alarm_on=1;}<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; if(hh_alarm*100+mm_alarm==hour*100+minut &amp;&amp; alarm==1 &amp;&amp; alarm_on==1){pic();/*Serial.println(&quot;ZZZZzzzz&quot;);*/}<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; if(digitalRead(12)==LOW &amp;&amp; alarm_on==1){alarm_on=2;delay(200);}<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; delay(100);<br />}</p><p>void pic(){tone(9,2780,100);}// 9 - пин к которому подключен пьезодинамик, 2780 - частота, 100 - период</p>]]></content>
			<author>
				<name><![CDATA[Evgen326]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2451</uri>
			</author>
			<updated>2025-04-15T10:15:55Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=11764#p11764</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Часы (DS3231) с будильником (Arduino)]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=11763#p11763" />
			<content type="html"><![CDATA[<p>Получилось так<br /><span class="postimg"><img src="http://forum.rcl-radio.ru/uploads/images/2025/04/a519ae837fb988234c91e124a3511634.jpg" alt="http://forum.rcl-radio.ru/uploads/images/2025/04/a519ae837fb988234c91e124a3511634.jpg" /></span></p>]]></content>
			<author>
				<name><![CDATA[Evgen326]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2451</uri>
			</author>
			<updated>2025-04-15T10:13:56Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=11763#p11763</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Часы (DS3231) с будильником (Arduino)]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=11762#p11762" />
			<content type="html"><![CDATA[<p>liman324, добрый день.<br />1. Попробовал <br />lcd.createChar(5, customChar5); - не отображается, а вот строка ниже отлично отрабатывает<br />if(digitalRead(ALARM)==LOW){lcd.createChar(5, customChar5);lcd.setCursor(14, 1);lcd.write(5);}else{lcd.createChar(0, customChar0);lcd.setCursor(14, 1);lcd.write(0);}<br />2. На DS3231 убрал диод и резистор, проблема со сбросом времени ушла, да уж - намудрили китайцы!<br />3. От русских букв в дне неделе пришлось отказаться. Прописал сокращённые английские буквы.<br />Спасибо за помощь!</p>]]></content>
			<author>
				<name><![CDATA[Evgen326]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2451</uri>
			</author>
			<updated>2025-04-15T10:09:12Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=11762#p11762</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Часы (DS3231) с будильником (Arduino)]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=11759#p11759" />
			<content type="html"><![CDATA[<p>Спасибо, попробую.</p>]]></content>
			<author>
				<name><![CDATA[Evgen326]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2451</uri>
			</author>
			<updated>2025-04-11T15:32:18Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=11759#p11759</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Часы (DS3231) с будильником (Arduino)]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=11758#p11758" />
			<content type="html"><![CDATA[<p>lcd.createChar(5, customChar5);</p>]]></content>
			<author>
				<name><![CDATA[liman324]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2</uri>
			</author>
			<updated>2025-04-11T15:21:46Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=11758#p11758</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Часы (DS3231) с будильником (Arduino)]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=11757#p11757" />
			<content type="html"><![CDATA[<p>подскажите как в этой строке прописать значок будильника<br />if(digitalRead(ALARM)==LOW){digitalWrite(8,HIGH);alarm = 1;}else{digitalWrite(8,LOW);alarm = 0;}</p>]]></content>
			<author>
				<name><![CDATA[Evgen326]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2451</uri>
			</author>
			<updated>2025-04-11T14:59:46Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=11757#p11757</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Часы (DS3231) с будильником (Arduino)]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=11756#p11756" />
			<content type="html"><![CDATA[<p>все верно</p>]]></content>
			<author>
				<name><![CDATA[liman324]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2</uri>
			</author>
			<updated>2025-04-11T14:53:19Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=11756#p11756</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Часы (DS3231) с будильником (Arduino)]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=11755#p11755" />
			<content type="html"><![CDATA[<p>Я так и не понял, большими цифрами занято только 5 байт + 1 байт под значок будильника, если я неправ, поправьте меня</p>]]></content>
			<author>
				<name><![CDATA[Evgen326]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2451</uri>
			</author>
			<updated>2025-04-11T14:50:59Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=11755#p11755</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Часы (DS3231) с будильником (Arduino)]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=11754#p11754" />
			<content type="html"><![CDATA[<p>К сожалению второго модуля нет.</p>]]></content>
			<author>
				<name><![CDATA[Evgen326]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2451</uri>
			</author>
			<updated>2025-04-11T14:49:24Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=11754#p11754</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Часы (DS3231) с будильником (Arduino)]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=11753#p11753" />
			<content type="html"><![CDATA[<p>Когда питание в общую цепь подаёшь, то на 16 ноге появляется 3,3v, отключаешь общее питание и на 16 ноге 0.</p>]]></content>
			<author>
				<name><![CDATA[Evgen326]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2451</uri>
			</author>
			<updated>2025-04-11T14:47:41Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=11753#p11753</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Часы (DS3231) с будильником (Arduino)]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=11752#p11752" />
			<content type="html"><![CDATA[<p>У меня других вариантов нет, если есть второй модуль примените его, возможно дело в модуле.</p>]]></content>
			<author>
				<name><![CDATA[liman324]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2</uri>
			</author>
			<updated>2025-04-11T14:43:45Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=11752#p11752</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Часы (DS3231) с будильником (Arduino)]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=11751#p11751" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>liman324 пишет:</cite><blockquote><p>3B или немного меньше</p></blockquote></div><p>Ради спортивного интереса поставил после аккумулятора (с платой защиты) понижайку и выставил на ней 2,9В. Результат - 0<br /><span class="postimg"><img src="http://forum.rcl-radio.ru/uploads/images/2025/04/5c53b3c9940c4eefff96158cdde37efe.jpg" alt="http://forum.rcl-radio.ru/uploads/images/2025/04/5c53b3c9940c4eefff96158cdde37efe.jpg" /></span></p>]]></content>
			<author>
				<name><![CDATA[Evgen326]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2451</uri>
			</author>
			<updated>2025-04-11T14:40:56Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=11751#p11751</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Часы (DS3231) с будильником (Arduino)]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=11750#p11750" />
			<content type="html"><![CDATA[<p>Если бы у Вас был бы русифицированный дисплей, то все было бы намного проще</p>]]></content>
			<author>
				<name><![CDATA[liman324]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2</uri>
			</author>
			<updated>2025-04-11T13:51:35Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=11750#p11750</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Часы (DS3231) с будильником (Arduino)]]></title>
			<link rel="alternate" href="http://forum.rcl-radio.ru/viewtopic.php?pid=11749#p11749" />
			<content type="html"><![CDATA[<p>Вместо зажигания диода Вы можете выводить символ на LCD</p><p> if(digitalRead(ALARM)==LOW){digitalWrite(8,HIGH);alarm = 1;}else{digitalWrite(8,LOW);alarm = 0;}</p><p><span class="postimg"><img src="http://forum.rcl-radio.ru/uploads/images/2025/04/3aff5c78801f59d0852a96ebc8de9d17.png" alt="http://forum.rcl-radio.ru/uploads/images/2025/04/3aff5c78801f59d0852a96ebc8de9d17.png" /></span></p><p>Но значка будильника в наборе LCD1602 нет</p>]]></content>
			<author>
				<name><![CDATA[liman324]]></name>
				<uri>http://forum.rcl-radio.ru/profile.php?id=2</uri>
			</author>
			<updated>2025-04-11T13:50:08Z</updated>
			<id>http://forum.rcl-radio.ru/viewtopic.php?pid=11749#p11749</id>
		</entry>
</feed>
