<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[RemoteXY community — controlling a buzzer with remotexy]]></title>
		<link>https://forum.remotexy.com/viewtopic.php?id=1599</link>
		<atom:link href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1599&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in controlling a buzzer with remotexy.]]></description>
		<lastBuildDate>Tue, 31 Jan 2023 15:47:03 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: controlling a buzzer with remotexy]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4995#p4995</link>
			<description><![CDATA[<p>I was able to get the buzzer to work and the led to flash though when the led is flashing the buzzer will only make a sound when the led was on. Does anyone have a suggestion on how I can fix this?</p><p>/*<br />&nbsp; &nbsp;-- AllAround --<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;This source code of graphical user interface <br />&nbsp; &nbsp;has been generated automatically by RemoteXY editor.<br />&nbsp; &nbsp;To compile this code using RemoteXY library 3.1.8 or later version <br />&nbsp; &nbsp;download by link <a target="_blank" href="http://remotexy.com/en/library/">http://remotexy.com/en/library/</a><br />&nbsp; &nbsp;To connect using RemoteXY mobile app by link <a target="_blank" href="http://remotexy.com/en/download/">http://remotexy.com/en/download/</a>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp;- for ANDROID 4.11.1 or later version;<br />&nbsp; &nbsp; &nbsp;- for iOS 1.9.1 or later version;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp;This source code is free software; you can redistribute it and/or<br />&nbsp; &nbsp;modify it under the terms of the GNU Lesser General Public<br />&nbsp; &nbsp;License as published by the Free Software Foundation; either<br />&nbsp; &nbsp;version 2.1 of the License, or (at your option) any later version.&nbsp; &nbsp; <br />*/</p><p>//////////////////////////////////////////////<br />//&nbsp; &nbsp; &nbsp; &nbsp; RemoteXY include library&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //<br />//////////////////////////////////////////////</p><p>// RemoteXY select connection mode and include library <br />#define REMOTEXY_MODE__SOFTSERIAL<br />#include &lt;SoftwareSerial.h&gt;</p><p>#include &lt;RemoteXY.h&gt;</p><p>// RemoteXY connection settings <br />#define REMOTEXY_SERIAL_RX 2<br />#define REMOTEXY_SERIAL_TX 3<br />#define REMOTEXY_SERIAL_SPEED 9600</p><br /><p>// RemoteXY configurate&nbsp; <br />#pragma pack(push, 1)<br />uint8_t RemoteXY_CONF[] =&nbsp; &nbsp;// 107 bytes<br />&nbsp; { 255,2,0,0,0,100,0,16,223,2,2,1,4,18,22,11,22,25,22,11,<br />&nbsp; 224,26,31,31,79,78,0,79,70,70,0,129,0,35,5,27,6,18,10,18,<br />&nbsp; 6,17,65,108,108,32,65,114,111,117,110,100,0,2,1,72,19,22,11,22,<br />&nbsp; 58,22,11,224,26,31,31,79,78,0,79,70,70,0,129,0,12,14,6,3,<br />&nbsp; 29,20,8,4,24,76,69,68,0,129,0,78,15,10,3,27,53,13,4,8,<br />&nbsp; 66,117,122,122,101,114,0 };<br />&nbsp; <br />// this structure defines all the variables and events of your control interface <br />struct {</p><p>&nbsp; &nbsp; // input variables<br />&nbsp; uint8_t LED; // =1 if switch ON and =0 if OFF <br />&nbsp; uint8_t Buzzer; // =1 if switch ON and =0 if OFF </p><p>&nbsp; &nbsp; // other variable<br />&nbsp; uint8_t connect_flag;&nbsp; // =1 if wire connected, else =0 </p><p>} RemoteXY;<br />#pragma pack(pop)</p><p>/////////////////////////////////////////////<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;END RemoteXY include&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //<br />/////////////////////////////////////////////</p><p>#define PIN_LED 13<br />#define PIN_BUZZER 8</p><br /><p>void setup() <br />{<br />&nbsp; RemoteXY_Init (); <br />&nbsp; <br />&nbsp; pinMode (PIN_LED, OUTPUT);<br />&nbsp; pinMode (PIN_BUZZER, OUTPUT);<br />&nbsp; <br />&nbsp; // TODO you setup code<br />&nbsp; <br />}</p><p>void loop() <br />{ <br />&nbsp; RemoteXY_Handler ();<br />&nbsp; <br />&nbsp; digitalWrite(PIN_LED, (RemoteXY.LED==0)?LOW:HIGH);<br />&nbsp; digitalWrite(PIN_BUZZER, (RemoteXY.Buzzer==0)?LOW:HIGH);<br />&nbsp; if(RemoteXY.Buzzer!=0){<br />&nbsp; &nbsp; tone(8,400,100);<br />&nbsp; &nbsp; tone(8,800,100);<br />&nbsp; &nbsp; tone(8,400,100);<br />&nbsp; }<br />if(RemoteXY.LED!=0){<br />&nbsp; digitalWrite(PIN_LED,HIGH); // turn the LED on<br />&nbsp; delay(1000); // wait a second</p><p>&nbsp; digitalWrite(PIN_LED,LOW); // turn the LED off<br />&nbsp; delay(500); // wait a second&nbsp; <br />}<br />&nbsp; <br />&nbsp; // TODO you loop code<br />&nbsp; // use the RemoteXY structure for data transfer<br />&nbsp; // do not call delay() </p><br /><p>}</p>]]></description>
			<author><![CDATA[null@example.com (Dalevy)]]></author>
			<pubDate>Tue, 31 Jan 2023 15:47:03 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4995#p4995</guid>
		</item>
		<item>
			<title><![CDATA[controlling a buzzer with remotexy]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=4983#p4983</link>
			<description><![CDATA[<p>Hi, Im working on a circuit that I can use to help me find lost belongings. It has a led and a piezo buzzer, but I&#039;m unable to get the buzzer to function properly. I have 2 switches on remotexy one to turn on a led the other to make the piezo buzzer play a siren sound. Im able to get the buzzer to start playing the sound but then it won&#039;t stop. Does anyone know how I can get the buzzer to turn off when I switch it off not the remotexy app? I also want to get the led to flash in a sequence though similar to the buzzer I can&#039;t figure out how to get it to work.</p><p>here is my current code.</p><p>/*<br />&nbsp; &nbsp;-- AllAround --<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;This source code of graphical user interface <br />&nbsp; &nbsp;has been generated automatically by RemoteXY editor.<br />&nbsp; &nbsp;To compile this code using RemoteXY library 3.1.8 or later version <br />&nbsp; &nbsp;download by link <a target="_blank" href="http://remotexy.com/en/library/">http://remotexy.com/en/library/</a><br />&nbsp; &nbsp;To connect using RemoteXY mobile app by link <a target="_blank" href="http://remotexy.com/en/download/">http://remotexy.com/en/download/</a>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp;- for ANDROID 4.11.1 or later version;<br />&nbsp; &nbsp; &nbsp;- for iOS 1.9.1 or later version;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp;This source code is free software; you can redistribute it and/or<br />&nbsp; &nbsp;modify it under the terms of the GNU Lesser General Public<br />&nbsp; &nbsp;License as published by the Free Software Foundation; either<br />&nbsp; &nbsp;version 2.1 of the License, or (at your option) any later version.&nbsp; &nbsp; <br />*/</p><p>//////////////////////////////////////////////<br />//&nbsp; &nbsp; &nbsp; &nbsp; RemoteXY include library&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //<br />//////////////////////////////////////////////</p><p>// RemoteXY select connection mode and include library <br />#define REMOTEXY_MODE__SOFTSERIAL<br />#include &lt;SoftwareSerial.h&gt;</p><p>#include &lt;RemoteXY.h&gt;</p><p>// RemoteXY connection settings <br />#define REMOTEXY_SERIAL_RX 2<br />#define REMOTEXY_SERIAL_TX 3<br />#define REMOTEXY_SERIAL_SPEED 9600</p><br /><p>// RemoteXY configurate&nbsp; <br />#pragma pack(push, 1)<br />uint8_t RemoteXY_CONF[] =&nbsp; &nbsp;// 130 bytes<br />&nbsp; { 255,3,0,2,0,123,0,16,223,2,2,1,4,18,22,11,7,25,22,11,<br />&nbsp; 224,26,31,31,79,78,0,79,70,70,0,129,0,35,5,27,6,18,10,18,<br />&nbsp; 6,17,65,108,108,32,65,114,111,117,110,100,0,2,1,72,19,22,11,7,<br />&nbsp; 58,22,11,224,26,31,31,79,78,0,79,70,70,0,69,0,45,32,10,10,<br />&nbsp; 13,41,10,10,1,4,16,41,21,18,7,45,24,10,45,2,26,129,0,12,<br />&nbsp; 14,6,3,14,20,8,4,24,76,69,68,0,129,0,78,15,10,3,12,53,<br />&nbsp; 13,4,8,66,117,122,122,101,114,0 };<br />&nbsp; <br />// this structure defines all the variables and events of your control interface <br />struct {</p><p>&nbsp; &nbsp; // input variables<br />&nbsp; uint8_t LED; // =1 if switch ON and =0 if OFF <br />&nbsp; uint8_t Buzzer; // =1 if switch ON and =0 if OFF <br />&nbsp; int8_t slider_1; // =0..100 slider position </p><p>&nbsp; &nbsp; // output variables<br />&nbsp; int16_t sound_1; // =0 no sound, else ID of sound, =1001 for example, look sound list in app </p><p>&nbsp; &nbsp; // other variable<br />&nbsp; uint8_t connect_flag;&nbsp; // =1 if wire connected, else =0 </p><p>} RemoteXY;<br />#pragma pack(pop)</p><p>/////////////////////////////////////////////<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;END RemoteXY include&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //<br />/////////////////////////////////////////////</p><p>#define PIN_LED 13<br />#define PIN_BUZZER 8</p><br /><br /><p>void setup() <br />{<br />&nbsp; RemoteXY_Init (); <br />&nbsp; <br />&nbsp; pinMode (PIN_LED, OUTPUT);<br />&nbsp; pinMode (PIN_BUZZER, OUTPUT);<br />&nbsp; <br />&nbsp; // TODO you setup code<br />&nbsp; <br />}</p><p>void loop() <br />{ <br />&nbsp; RemoteXY_Handler ();<br />&nbsp; <br />&nbsp; digitalWrite(PIN_LED, (RemoteXY.LED==0)?LOW:HIGH);<br />&nbsp; digitalRead(PIN_BUZZER, (RemoteXY.Buzzer==0)?LOW:HIGH);<br />&nbsp; if (digitalRead(8) == HIGH) {&nbsp; <br /> digitalWrite(PIN_BUZZER, HIGH);<br />&nbsp; //siren going up<br />&nbsp; for (int frequency=650; frequency&lt;900; frequency++) {<br />&nbsp; &nbsp; tone(8, frequency);<br />&nbsp; &nbsp; delay(10);<br />&nbsp; }<br />&nbsp; digitalWrite(PIN_BUZZER, LOW);<br />&nbsp; // siren going down<br />&nbsp; for (int frequency=900; frequency&gt;=650; frequency--) {<br />&nbsp; &nbsp; tone(8, frequency);<br />&nbsp; &nbsp; delay(10);<br />&nbsp; }<br />}</p><br /><p>else {<br /> digitalWrite(PIN_BUZZER,0); //If the switch isn’t pressed, buzzer off.<br />&nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; delay(10); //reading delay<br />}<br />&nbsp; <br />&nbsp; // TODO you loop code<br />&nbsp; // use the RemoteXY structure for data transfer<br />&nbsp; // do not call delay()</p>]]></description>
			<author><![CDATA[null@example.com (Dalevy)]]></author>
			<pubDate>Fri, 27 Jan 2023 20:27:19 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=4983#p4983</guid>
		</item>
	</channel>
</rss>
