<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — Контроль газа на даче.]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=907&amp;type=atom" />
	<updated>2020-02-29T09:14:12Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=907</id>
		<entry>
			<title type="html"><![CDATA[Re: Контроль газа на даче.]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2628#p2628" />
			<content type="html"><![CDATA[<p>Все переделал.Оставил динамик,и сирену в доме.<br />&quot;delay&quot; убрал,спасибо поиску.<br />Оставил только цифровой выход датчика.</p><div class="codebox"><pre><code> 

// РѕРїСЂРµРґРµР»РµРЅРёРµ СЂРµР¶РёРјР° СЃРѕРµРґРёРЅРµРЅРёСЏ Рё РїРѕРґРєР»СЋС‡РµРЅРёРµ Р±РёР±Р»РёРѕС‚РµРєРё RemoteXY 
#define REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT

#include &lt;RemoteXY.h&gt;
#include &quot;pitches.h&quot;  
int melody[]={NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, 0, NOTE_B3, NOTE_C4};

#define PIRPin 4 
int noteDurations[]={4, 8, 8, 4, 4, 4, 4, 4};

// РЅР°СЃС‚СЂРѕР№РєРё СЃРѕРµРґРёРЅРµРЅРёСЏ 
#define REMOTEXY_SERIAL Serial
#define REMOTEXY_SERIAL_SPEED 115200
#define REMOTEXY_WIFI_SSID &quot;RemoteXY&quot;
#define REMOTEXY_WIFI_PASSWORD &quot;jriy1951&quot;
#define REMOTEXY_SERVER_PORT 6377
#define REMOTEXY_ACCESS_PASSWORD &quot;jriy51&quot;


// РєРѕРЅС„РёРіСѓСЂР°С†РёСЏ РёРЅС‚РµСЂС„РµР№СЃР°  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,0,0,13,0,19,0,10,13,1,
  69,0,11,41,42,42,1,67,4,11,
  15,40,13,36,0,11 };
  
// СЃС‚СЂСѓРєС‚СѓСЂР° РѕРїСЂРµРґРµР»СЏРµС‚ РІСЃРµ РїРµСЂРµРјРµРЅРЅС‹Рµ Рё СЃРѕР±С‹С‚РёСЏ РІР°С€РµРіРѕ РёРЅС‚РµСЂС„РµР№СЃР° СѓРїСЂР°РІР»РµРЅРёСЏ 
struct {

    // output variables
  int16_t sound_1; // =0 РЅРµС‚ Р·РІСѓРєР°, РёРЅР°С‡Рµ ID Р·РІСѓРєР°, РґР»СЏ РїСЂРёРјРµСЂР° 1001, СЃРјРѕС‚СЂРё СЃРїРёСЃРѕРє Р·РІСѓРєРѕРІ РІ РїСЂРёР»РѕР¶РµРЅРёРё 
  char text_1[11];  // =СЃС‚СЂРѕРєР° UTF8 РѕРєР°РЅС‡РёРІР°СЋС‰Р°СЏСЃСЏ РЅСѓР»РµРј 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////



void setup() 
{
  RemoteXY_Init (); 
  
  {  
 

pinMode(PIRPin,INPUT);
}



  // TODO you setup code
  
}

void loop() 
{ 
  RemoteXY_Handler ();
    
 strcpy(RemoteXY.text_1, &quot;/MQ-5/&quot;);
           
if (digitalRead(PIRPin) == LOW)
   {
    RemoteXY.sound_1 = 2015;

   }     
  else { 
 
      RemoteXY.sound_1 = 0;
 }   

//} 
int buttonState = digitalRead(PIRPin);
 if (buttonState == 0){ 
   for (int thisNote=0; thisNote &lt;8; thisNote++){   
     if (thisNote%3==0){    
     }
     else if (thisNote%3==1){   
     }
     else if (thisNote%3==2){    
     }
          int noteDuration = 1000 / noteDurations [thisNote];
     tone(5, melody [thisNote], noteDuration);    
     int pauseBetweenNotes = noteDuration * 1.30;
     delay(pauseBetweenNotes);
     noTone(8);
   }
 }
}

 </code></pre></div>]]></content>
			<author>
				<name><![CDATA[jriy18]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1233</uri>
			</author>
			<updated>2020-02-29T09:14:12Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2628#p2628</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Контроль газа на даче.]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2625#p2625" />
			<content type="html"><![CDATA[<p>Еще раз,благодарю за разработку.Сирена завыла.</p>]]></content>
			<author>
				<name><![CDATA[jriy18]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1233</uri>
			</author>
			<updated>2020-02-28T11:36:36Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2625#p2625</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Контроль газа на даче.]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2624#p2624" />
			<content type="html"><![CDATA[<p>Благодарю.<br />А с делау,это самое простое.Я даже не &quot;чайник&quot; в этом деле,все методом тыка,<br />не въезжая для чего, почему.Я пробовал,но,компилятор,ругается.Бросил.<br />Пусть пока так.На даче перепишем.Целое лето.<br />Но вроде связь не пропадает.</p>]]></content>
			<author>
				<name><![CDATA[jriy18]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1233</uri>
			</author>
			<updated>2020-02-28T11:26:53Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2624#p2624</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Контроль газа на даче.]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2623#p2623" />
			<content type="html"><![CDATA[<p>Для сирены используйте<br /></p><div class="codebox"><pre><code>RemoteXY.sound_1 = 2001; // от 2001 до 2035 - разные сирены</code></pre></div><p>Еще рекомендую в вашем коде избавиться от операторов delay. Из за них будет теряться связь со смартфоном. Например в вашем коде, когда начинает играть подключенный к контроллеру динамик, связь со смартфоном останавливается и прервется по таймауту. Как переделать код на &quot;без delay&quot; можно найти много статей в интернете <a target="_blank" href="https://www.google.com/search?q=arduino+%D0%B1%D0%B5%D0%B7+delay">https://www.google.com/search?q=arduino … 0%B7+delay</a></p>]]></content>
			<author>
				<name><![CDATA[remotexy]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2</uri>
			</author>
			<updated>2020-02-28T09:02:51Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2623#p2623</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Контроль газа на даче.]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2622#p2622" />
			<content type="html"><![CDATA[<p>Благодарю.Чего то зацокало.Маленько не то,хотел сирену но пока пойдет.<br />Вообщим все заработало,но утечки надеюсь не будет.<br />Код рабочий.</p><div class="codebox"><pre><code>//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// РѕРїСЂРµРґРµР»РµРЅРёРµ СЂРµР¶РёРјР° СЃРѕРµРґРёРЅРµРЅРёСЏ Рё РїРѕРґРєР»СЋС‡РµРЅРёРµ Р±РёР±Р»РёРѕС‚РµРєРё RemoteXY 
#define REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT

#include &lt;RemoteXY.h&gt;
int buzzer_pin = 10;
int smoke_sensor_pin = A0;

// РЅР°СЃС‚СЂРѕР№РєРё СЃРѕРµРґРёРЅРµРЅРёСЏ 
#define REMOTEXY_SERIAL Serial
#define REMOTEXY_SERIAL_SPEED 115200
#define REMOTEXY_WIFI_SSID &quot;RemoteXY&quot;
#define REMOTEXY_WIFI_PASSWORD &quot;---&quot;
#define REMOTEXY_SERVER_PORT 6377
#define REMOTEXY_ACCESS_PASSWORD &quot;---&quot;


// РєРѕРЅС„РёРіСѓСЂР°С†РёСЏ РёРЅС‚РµСЂС„РµР№СЃР°  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,0,0,14,0,27,0,10,165,1,
  69,0,18,13,25,25,1,66,132,13,
  63,35,27,2,24,67,4,16,46,30,
  10,2,26,11 };
  
// СЃС‚СЂСѓРєС‚СѓСЂР° РѕРїСЂРµРґРµР»СЏРµС‚ РІСЃРµ РїРµСЂРµРјРµРЅРЅС‹Рµ Рё СЃРѕР±С‹С‚РёСЏ РІР°С€РµРіРѕ РёРЅС‚РµСЂС„РµР№СЃР° СѓРїСЂР°РІР»РµРЅРёСЏ 
struct {

    // output variables
  uint16_t sound_1; // =0 РЅРµС‚ Р·РІСѓРєР°, РёРЅР°С‡Рµ ID Р·РІСѓРєР°, РґР»СЏ РїСЂРёРјРµСЂР° 1001, СЃРјРѕС‚СЂРё СЃРїРёСЃРѕРє Р·РІСѓРєРѕРІ РІ РїСЂРёР»РѕР¶РµРЅРёРё 
  int8_t level_1; // =0..100 РїРѕР»РѕР¶РµРЅРёРµ СѓСЂРѕРІРЅСЏ 
  char text_1[11];  // =СЃС‚СЂРѕРєР° UTF8 РѕРєР°РЅС‡РёРІР°СЋС‰Р°СЏСЃСЏ РЅСѓР»РµРј 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////
int button_pin = 5;

void setup() 
{
  RemoteXY_Init (); 
 pinMode(buzzer_pin, OUTPUT);
  pinMode(smoke_sensor_pin, INPUT);  
    pinMode(button_pin, INPUT);
 
  // TODO you setup code
  
}

void loop() 
{ 
{ 
  RemoteXY_Handler ();
  
 
       
  }

  int analogSensor = analogRead(smoke_sensor_pin);
if (analogSensor &gt; 400){
tone(buzzer_pin, 440, 250); 
    delay(250);
    tone(buzzer_pin, 165, 250);
    delay(250);
    tone(buzzer_pin, 440, 250);
    delay(250);
    delay(250);
    
    tone(buzzer_pin, 440, 250);
    delay(250);
    tone(buzzer_pin, 165, 250);
    delay(250);
    tone(buzzer_pin, 440, 250);
    delay(250);
    delay(250);
    
    tone(buzzer_pin, 330, 125);
    delay(125);
    tone(buzzer_pin, 294, 125);
    delay(125);
    tone(buzzer_pin, 262, 125);
    delay(124);
    tone(buzzer_pin, 494, 125);
    delay(125);
    tone(buzzer_pin, 440, 125);
    delay(125);
    tone(buzzer_pin, 494, 125);
    delay(125);
    tone(buzzer_pin, 262, 125);
    delay(125);
    tone(buzzer_pin, 294, 125);
    delay(125);
    
    tone(buzzer_pin, 330, 250);
    delay(250);
    tone(buzzer_pin, 165, 250);
    delay(250);
    tone(buzzer_pin, 440, 250);
    
    delay(500);
  

    } else {
   noTone(buzzer_pin);
 strcpy(RemoteXY.text_1, &quot;/MQ-5/&quot;);
delay(50);

  }
int sensorValue1 =analogRead(smoke_sensor_pin);//tblack
 int num = map(sensorValue1, 0, 1023, 0, 100); 
 RemoteXY.level_1 = num; 
delay(50);

 
  if (digitalRead(button_pin) == HIGH)
   {
    RemoteXY.sound_1 = 1001;

         }
  else { 

      RemoteXY.sound_1 = 0;
   }   
       
  
}
   </code></pre></div>]]></content>
			<author>
				<name><![CDATA[jriy18]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1233</uri>
			</author>
			<updated>2020-02-28T07:54:08Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2622#p2622</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Контроль газа на даче.]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2620#p2620" />
			<content type="html"><![CDATA[<p>Замените строчку <br /></p><div class="codebox"><pre><code>RemoteXY.sound_1 = 10;</code></pre></div><p>на <br /></p><div class="codebox"><pre><code>RemoteXY.sound_1 = 1001;</code></pre></div><p>Дополнительная информация доступна тут <a target="_blank" href="https://remotexy.com/ru/help/controls/sound/">https://remotexy.com/ru/help/controls/sound/</a><br /></p><div class="quotebox"><blockquote><p>Для выбора звукового эффекта и определения его идентификатора необходимо в приложении открыть список звуковых эффектов, который находится в «Настройки» / «Список звуков». В списке вы можете прослушать звуковые эффекты, выбрать подходящий, и использовать его идентификатор при разработке программы для контроллера.</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[remotexy]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2</uri>
			</author>
			<updated>2020-02-28T06:46:21Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2620#p2620</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Контроль газа на даче.]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2619#p2619" />
			<content type="html"><![CDATA[<p>Ни каких идей не появилось?<br />Как все таки заставить петь?</p>]]></content>
			<author>
				<name><![CDATA[jriy18]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1233</uri>
			</author>
			<updated>2020-02-28T05:20:22Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2619#p2619</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Контроль газа на даче.]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=2597#p2597" />
			<content type="html"><![CDATA[<p>Решил сделать сигнализацию утечки газа на даче.<br />Что бы на телефоне было видно,ну и в доме.<br />С домом проблем нет.Датчик MQ-6,ардуино нано,<br />и пищалка,или усилок на TDA7052AT/N2.112 поставлю.<br />Чтобы громко.На телефон тоже выходит нормально,<br />почти.Со звуком непонятно.Где,как,выбирать звук?<br />Что за приложения с номерами?Скетч вот такой.<br />Динамик на телефоне моргает.При нажатии кнопки,ну<br />или,цифровой выход с датчика.<br /></p><div class="codebox"><pre><code>//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// РѕРїСЂРµРґРµР»РµРЅРёРµ СЂРµР¶РёРјР° СЃРѕРµРґРёРЅРµРЅРёСЏ Рё РїРѕРґРєР»СЋС‡РµРЅРёРµ Р±РёР±Р»РёРѕС‚РµРєРё RemoteXY 
#define REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT

#include &lt;RemoteXY.h&gt;
int buzzer_pin = 10;
int smoke_sensor_pin = A0;

// РЅР°СЃС‚СЂРѕР№РєРё СЃРѕРµРґРёРЅРµРЅРёСЏ 
#define REMOTEXY_SERIAL Serial
#define REMOTEXY_SERIAL_SPEED 115200
#define REMOTEXY_WIFI_SSID &quot;RemoteXY&quot;
#define REMOTEXY_WIFI_PASSWORD &quot;---&quot;
#define REMOTEXY_SERVER_PORT 6377
#define REMOTEXY_ACCESS_PASSWORD &quot;===&quot;


// РєРѕРЅС„РёРіСѓСЂР°С†РёСЏ РёРЅС‚РµСЂС„РµР№СЃР°  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,0,0,14,0,27,0,10,165,1,
  69,0,18,13,25,25,1,66,132,13,
  63,35,27,2,24,67,4,16,46,30,
  10,2,26,11 };
  
// СЃС‚СЂСѓРєС‚СѓСЂР° РѕРїСЂРµРґРµР»СЏРµС‚ РІСЃРµ РїРµСЂРµРјРµРЅРЅС‹Рµ Рё СЃРѕР±С‹С‚РёСЏ РІР°С€РµРіРѕ РёРЅС‚РµСЂС„РµР№СЃР° СѓРїСЂР°РІР»РµРЅРёСЏ 
struct {

    // output variables
  uint16_t sound_1; // =0 РЅРµС‚ Р·РІСѓРєР°, РёРЅР°С‡Рµ ID Р·РІСѓРєР°, РґР»СЏ РїСЂРёРјРµСЂР° 1001, СЃРјРѕС‚СЂРё СЃРїРёСЃРѕРє Р·РІСѓРєРѕРІ РІ РїСЂРёР»РѕР¶РµРЅРёРё 
  int8_t level_1; // =0..100 РїРѕР»РѕР¶РµРЅРёРµ СѓСЂРѕРІРЅСЏ 
  char text_1[11];  // =СЃС‚СЂРѕРєР° UTF8 РѕРєР°РЅС‡РёРІР°СЋС‰Р°СЏСЃСЏ РЅСѓР»РµРј 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////
int button_pin = 5;

void setup() 
{
  RemoteXY_Init (); 
 pinMode(buzzer_pin, OUTPUT);
  pinMode(smoke_sensor_pin, INPUT);  
    pinMode(button_pin, INPUT);
 
  // TODO you setup code
  
}

void loop() 
{ 
{ 
  RemoteXY_Handler ();
  
 
       
  }

  int analogSensor = analogRead(smoke_sensor_pin);
if (analogSensor &gt; 400){
tone(buzzer_pin, 440, 250); 
    delay(250);
    tone(buzzer_pin, 165, 250);
    delay(250);
    tone(buzzer_pin, 440, 250);
    delay(250);
    delay(250);
    
    tone(buzzer_pin, 440, 250);
    delay(250);
    tone(buzzer_pin, 165, 250);
    delay(250);
    tone(buzzer_pin, 440, 250);
    delay(250);
    delay(250);
    
    tone(buzzer_pin, 330, 125);
    delay(125);
    tone(buzzer_pin, 294, 125);
    delay(125);
    tone(buzzer_pin, 262, 125);
    delay(124);
    tone(buzzer_pin, 494, 125);
    delay(125);
    tone(buzzer_pin, 440, 125);
    delay(125);
    tone(buzzer_pin, 494, 125);
    delay(125);
    tone(buzzer_pin, 262, 125);
    delay(125);
    tone(buzzer_pin, 294, 125);
    delay(125);
    
    tone(buzzer_pin, 330, 250);
    delay(250);
    tone(buzzer_pin, 165, 250);
    delay(250);
    tone(buzzer_pin, 440, 250);
    
    delay(500);
  

    } else {
   noTone(buzzer_pin);
 strcpy(RemoteXY.text_1, &quot;/MQ-5/&quot;);
  }
int sensorValue1 =analogRead(smoke_sensor_pin);//tblack
 int num = map(sensorValue1, 0, 1023, 0, 100); 
 RemoteXY.level_1 = num; 
 
  if (digitalRead(button_pin) == HIGH)
   {
    RemoteXY.sound_1 = 10;

         }
  else { //РРЅР°С‡Рµ

      RemoteXY.sound_1 = 0;
   }   
       
  
}</code></pre></div><p><span class="postimg"><img src="https://dropmefiles.com/wcT4O" alt="https://dropmefiles.com/wcT4O" /></span></p>]]></content>
			<author>
				<name><![CDATA[jriy18]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1233</uri>
			</author>
			<updated>2020-02-25T11:32:04Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=2597#p2597</id>
		</entry>
</feed>
