<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Need Help with my HC 05 Bluetooth Pair (Master and slave) - Project Corner				            </title>
            <link>https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/</link>
            <description>Discussion board for Robotics, Arduino, Raspberry Pi and other DIY electronics and modules. Join us today!</description>
            <language>en-US</language>
            <lastBuildDate>Sun, 12 Jul 2026 14:40:15 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: Need Help with my HC 05 Bluetooth Pair (Master and slave)</title>
                        <link>https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13511</link>
                        <pubDate>Wed, 04 Nov 2020 12:36:21 +0000</pubDate>
                        <description><![CDATA[Posted by: @gulshan 
i thought potentiometer and joystick module were suppose to be same thing

My joystick has 2 potentiometers for the x and y axis and additionally has an addition swit...]]></description>
                        <content:encoded><![CDATA[<blockquote data-userid="1178" data-postid="13492" data-mention="gulshan">
<div class="wpforo-post-quote-author"><strong> Posted by: @gulshan </strong></div>
<p>i thought potentiometer and joystick module were <br />suppose to be same thing</p>
</blockquote>
<p>My joystick has 2 potentiometers for the x and y axis and additionally has an addition switch connection.  (so 3 signal wires).  The joystick potentiometer will be centralised so the values can go up or down and the analogue signals are usually mapped something like</p>
<pre><span>  <span class="nv">mapX</span> <span class="o">=</span> map<span class="o">(</span>xPosition, <span class="m">0</span>, <span class="m">1023</span>, -512, <span class="m">512</span><span class="o">)</span><span class="p">;</span>
</span><span>  <span class="nv">mapY</span> <span class="o">=</span> map<span class="o">(</span>yPosition, <span class="m">0</span>, <span class="m">1023</span>, -512, <span class="m">512</span><span class="o">)</span><span class="p">;</span>
</span></pre>
<p>So your 'potentiometer' mapping looks wrong to me if using a joystick.  Have you checked you are on the right track by getting  the joystick/motor working with just one Arduino to check out the correct wiring etc.?</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/project-help/">Project Corner</category>                        <dc:creator>byron</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13511</guid>
                    </item>
				                    <item>
                        <title>RE: Need Help with my HC 05 Bluetooth Pair (Master and slave)</title>
                        <link>https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13507</link>
                        <pubDate>Wed, 04 Nov 2020 07:15:50 +0000</pubDate>
                        <description><![CDATA[@gulshan

 Posted by: @gulshan 
@frogandtoad Thank you again, i am gonna try changing it again tomorrow.
Sorry for the late reply actually i was quarantined so all i could do is read you...]]></description>
                        <content:encoded><![CDATA[<p>@gulshan</p>
<blockquote data-userid="1178" data-postid="13492" data-mention="gulshan">
<div class="wpforo-post-quote-author"><strong> Posted by: @gulshan </strong></div>
<p><a title="frogandtoad" href="https://forum.dronebotworkshop.com/profile/frogandtoad/">@frogandtoad</a> Thank you again, i am gonna try changing it again tomorrow.</p>
<p>Sorry for the late reply actually i was quarantined so all i could do is read your reply but couldn't reply back to you.</p>
</blockquote>
<p>No problem... you have no idea what kind of totalitarian dictatorship I'm going through here in Aus!</p>
<p>Go Trump!</p>
<p>Anyway, back to the fun stuff!</p>
<blockquote data-userid="1178" data-postid="13492" data-mention="gulshan">
<div class="wpforo-post-quote-author"><strong> Posted by: @gulshan </strong></div>
<p>Here is my problem the led is blinking as it should be but in my setup but i have a joystick <br />module at the transmitter end which controls the servo motor of the receiver end and it is not <br />working, the servo motor are not even responding to it and i can't understand why. Cause i thought potentiometer and joystick module were <br />suppose to be same thing</p>
</blockquote>
<p>Ok, assuming they are connected via serial, I think I can see your problem.</p>
<p>Serial.write(...) has overloaded versions of it so it can send a single byte, or a string etc... you are using the byte overload of write() to send an integer of 2 bytes, and on the receiving end, read() is also looking to read one character at a time.</p>
<p>The easiest way to solve this problem, is to write a string or array of bytes from the transmitter end, and then read it back using on the receiver end using Serial.parseInt(), or if you have a need to stuff it in a string for some reason, Serial.readLine() or Serial.readLineUntil('\n').</p>
<p>Cheers.</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/project-help/">Project Corner</category>                        <dc:creator>frogandtoad</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13507</guid>
                    </item>
				                    <item>
                        <title>RE: Need Help with my HC 05 Bluetooth Pair (Master and slave)</title>
                        <link>https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13492</link>
                        <pubDate>Tue, 03 Nov 2020 14:32:11 +0000</pubDate>
                        <description><![CDATA[@frogandtoad Thank you again, i am gonna try changing it again tomorrow.
Sorry for the late reply actually i was quarantined so all i could do is read your reply but couldn&#039;t reply back to ...]]></description>
                        <content:encoded><![CDATA[<p>@frogandtoad Thank you again, i am gonna try changing it again tomorrow.</p>
<p>Sorry for the late reply actually i was quarantined so all i could do is read your reply but couldn't reply back to you. out of all the tutorial videos that i have seen about this topic some people simply used the potentiometer knob sketch and split it into a transmitter and a reciever sketch. just as one shown below:</p>
<p><span style="text-decoration: underline"><strong>TRANSMITTER</strong></span></p>
<p> </p>
<pre><span style="color: #5e6d03">#define</span> <span style="color: #000000">ledPin</span> <span style="color: #000000">9</span>

<span style="color: #00979c">int</span> <span style="color: #000000">state</span> <span style="color: #434f54">=</span> <span style="color: #000000">0</span><span style="color: #000000">;</span>
<span style="color: #00979c">int</span> <span style="color: #000000">potValue</span> <span style="color: #434f54">=</span> <span style="color: #000000">0</span><span style="color: #000000">;</span>

<span style="color: #00979c">void</span> <span style="color: #5e6d03">setup</span><span style="color: #000000">(</span><span style="color: #000000">)</span> <span style="color: #000000">{</span>
  <span style="color: #d35400">pinMode</span><span style="color: #000000">(</span><span style="color: #000000">ledPin</span><span style="color: #434f54">,</span> <span style="color: #00979c">OUTPUT</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
  <span style="color: #d35400">digitalWrite</span><span style="color: #000000">(</span><span style="color: #000000">ledPin</span><span style="color: #434f54">,</span> <span style="color: #00979c">LOW</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
  <strong><span style="color: #d35400">Serial</span></strong><span style="color: #434f54">.</span><span style="color: #d35400">begin</span><span style="color: #000000">(</span><span style="color: #000000">9600</span><span style="color: #000000">)</span><span style="color: #000000">;</span> <span style="color: #434f54">// Default communication rate of the Bluetooth module</span>
<span style="color: #000000">}</span>

<span style="color: #00979c">void</span> <span style="color: #5e6d03">loop</span><span style="color: #000000">(</span><span style="color: #000000">)</span> <span style="color: #000000">{</span>
 <span style="color: #5e6d03">if</span><span style="color: #000000">(</span><strong><span style="color: #d35400">Serial</span></strong><span style="color: #434f54">.</span><span style="color: #d35400">available</span><span style="color: #000000">(</span><span style="color: #000000">)</span> <span style="color: #434f54">&gt;</span> <span style="color: #000000">0</span><span style="color: #000000">)</span><span style="color: #000000">{</span> <span style="color: #434f54">// Checks whether data is comming from the serial port</span>
    <span style="color: #000000">state</span> <span style="color: #434f54">=</span> <strong><span style="color: #d35400">Serial</span></strong><span style="color: #434f54">.</span><span style="color: #d35400">read</span><span style="color: #000000">(</span><span style="color: #000000">)</span><span style="color: #000000">;</span> <span style="color: #434f54">// Reads the data from the serial port</span>
 <span style="color: #000000">}</span>
 <span style="color: #434f54">// Controlling the LED</span>
 <span style="color: #5e6d03">if</span> <span style="color: #000000">(</span><span style="color: #000000">state</span> <span style="color: #434f54">==</span> <span style="color: #00979c">'1'</span><span style="color: #000000">)</span> <span style="color: #000000">{</span>
  <span style="color: #d35400">digitalWrite</span><span style="color: #000000">(</span><span style="color: #000000">ledPin</span><span style="color: #434f54">,</span> <span style="color: #00979c">HIGH</span><span style="color: #000000">)</span><span style="color: #000000">;</span> <span style="color: #434f54">// LED ON</span>
  <span style="color: #000000">state</span> <span style="color: #434f54">=</span> <span style="color: #000000">0</span><span style="color: #000000">;</span>
 <span style="color: #000000">}</span>
 <span style="color: #5e6d03">else</span> <span style="color: #5e6d03">if</span> <span style="color: #000000">(</span><span style="color: #000000">state</span> <span style="color: #434f54">==</span> <span style="color: #00979c">'0'</span><span style="color: #000000">)</span> <span style="color: #000000">{</span>
  <span style="color: #d35400">digitalWrite</span><span style="color: #000000">(</span><span style="color: #000000">ledPin</span><span style="color: #434f54">,</span> <span style="color: #00979c">LOW</span><span style="color: #000000">)</span><span style="color: #000000">;</span> <span style="color: #434f54">// LED ON</span>
  <span style="color: #000000">state</span> <span style="color: #434f54">=</span> <span style="color: #000000">0</span><span style="color: #000000">;</span>
 <span style="color: #000000">}</span>
 <span style="color: #434f54">// Reading the potentiometer</span>
 <span style="color: #000000">potValue</span> <span style="color: #434f54">=</span> <span style="color: #d35400">analogRead</span><span style="color: #000000">(</span><span style="color: #000000">A0</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
 <span style="color: #00979c">int</span> <span style="color: #000000">potValueMapped</span> <span style="color: #434f54">=</span> <span style="color: #d35400">map</span><span style="color: #000000">(</span><span style="color: #000000">potValue</span><span style="color: #434f54">,</span> <span style="color: #000000">0</span><span style="color: #434f54">,</span> <span style="color: #000000">1023</span><span style="color: #434f54">,</span> <span style="color: #000000">0</span><span style="color: #434f54">,</span> <span style="color: #000000">255</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
 <strong><span style="color: #d35400">Serial</span></strong><span style="color: #434f54">.</span><span style="color: #d35400">write</span><span style="color: #000000">(</span><span style="color: #000000">potValueMapped</span><span style="color: #000000">)</span><span style="color: #000000">;</span> <span style="color: #434f54">// Sends potValue to servo motor</span>
 <span style="color: #d35400">delay</span><span style="color: #000000">(</span><span style="color: #000000">10</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
<span style="color: #000000">}</span>
In this code at transmitter has a potentiometer is connected at pin A0 and a led connected to<br />pin 9 which can be controlled by the button on the slave end as given below:<br /><br /><br /><br /><br /><br /><span style="text-decoration: underline"><strong>RECEIVER</strong></span> <br />
<span style="color: #5e6d03">#include</span> <span style="color: #434f54">&lt;</span><strong><span style="color: #d35400">Servo</span></strong><span style="color: #434f54">.</span><span style="color: #000000">h</span><span style="color: #434f54">&gt;</span>
<span style="color: #5e6d03">#define</span> <span style="color: #000000">button</span> <span style="color: #000000">8</span>

<strong><span style="color: #d35400">Servo</span></strong> <span style="color: #000000">myServo</span><span style="color: #000000">;</span>
<span style="color: #00979c">int</span> <span style="color: #000000">state</span> <span style="color: #434f54">=</span> <span style="color: #000000">20</span><span style="color: #000000">;</span>
<span style="color: #00979c">int</span> <span style="color: #000000">buttonState</span> <span style="color: #434f54">=</span> <span style="color: #000000">0</span><span style="color: #000000">;</span>

<span style="color: #00979c">void</span> <span style="color: #5e6d03">setup</span><span style="color: #000000">(</span><span style="color: #000000">)</span> <span style="color: #000000">{</span>
  <span style="color: #d35400">pinMode</span><span style="color: #000000">(</span><span style="color: #000000">button</span><span style="color: #434f54">,</span> <span style="color: #00979c">INPUT</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
  <span style="color: #000000">myServo</span><span style="color: #434f54">.</span><span style="color: #d35400">attach</span><span style="color: #000000">(</span><span style="color: #000000">9</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
  <strong><span style="color: #d35400">Serial</span></strong><span style="color: #434f54">.</span><span style="color: #d35400">begin</span><span style="color: #000000">(</span><span style="color: #000000">9600</span><span style="color: #000000">)</span><span style="color: #000000">;</span> <span style="color: #434f54">// Default communication rate of the Bluetooth module</span>
<span style="color: #000000">}</span>

<span style="color: #00979c">void</span> <span style="color: #5e6d03">loop</span><span style="color: #000000">(</span><span style="color: #000000">)</span> <span style="color: #000000">{</span>
 <span style="color: #5e6d03">if</span><span style="color: #000000">(</span><strong><span style="color: #d35400">Serial</span></strong><span style="color: #434f54">.</span><span style="color: #d35400">available</span><span style="color: #000000">(</span><span style="color: #000000">)</span> <span style="color: #434f54">&gt;</span> <span style="color: #000000">0</span><span style="color: #000000">)</span><span style="color: #000000">{</span> <span style="color: #434f54">// Checks whether data is comming from the serial port</span>
    <span style="color: #000000">state</span> <span style="color: #434f54">=</span> <strong><span style="color: #d35400">Serial</span></strong><span style="color: #434f54">.</span><span style="color: #d35400">read</span><span style="color: #000000">(</span><span style="color: #000000">)</span><span style="color: #000000">;</span> <span style="color: #434f54">// Reads the data from the serial port</span>
 <span style="color: #000000">}</span>
 <span style="color: #434f54">// Controlling the servo motor</span>
 <span style="color: #000000">myServo</span><span style="color: #434f54">.</span><span style="color: #d35400">write</span><span style="color: #000000">(</span><span style="color: #000000">state</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
 <span style="color: #d35400">delay</span><span style="color: #000000">(</span><span style="color: #000000">10</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
 
 <span style="color: #434f54">// Reading the button</span>
 <span style="color: #000000">buttonState</span> <span style="color: #434f54">=</span> <span style="color: #d35400">digitalRead</span><span style="color: #000000">(</span><span style="color: #000000">button</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
 <span style="color: #5e6d03">if</span> <span style="color: #000000">(</span><span style="color: #000000">buttonState</span> <span style="color: #434f54">==</span> <span style="color: #00979c">HIGH</span><span style="color: #000000">)</span> <span style="color: #000000">{</span>
   <strong><span style="color: #d35400">Serial</span></strong><span style="color: #434f54">.</span><span style="color: #d35400">write</span><span style="color: #000000">(</span><span style="color: #00979c">'1'</span><span style="color: #000000">)</span><span style="color: #000000">;</span> <span style="color: #434f54">// Sends '1' to the master to turn on LED</span>
 <span style="color: #000000">}</span>
 <span style="color: #5e6d03">else</span> <span style="color: #000000">{</span>
   <strong><span style="color: #d35400">Serial</span></strong><span style="color: #434f54">.</span><span style="color: #d35400">write</span><span style="color: #000000">(</span><span style="color: #00979c">'0'</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
 <span style="color: #000000">}</span>  
<span style="color: #000000">}</span>
<br />Here a button is connected to pin 8 which controls led of the master module and<br />servo motor {our main topic of discussion} connected to pin 9.<br /><br /><span style="text-decoration: underline"><strong>Here is my problem the led is blinking as it should be but in my setup but i have a joystick <br />module at the transmitter end which controls the servo motor of the receiver end and it is not <br />working, the servo motor are not even responding to it and i can't understand why. Cause i thought potentiometer and joystick module were <br />suppose to be same thing</strong>
</span></pre>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/project-help/">Project Corner</category>                        <dc:creator>Gulshan</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13492</guid>
                    </item>
				                    <item>
                        <title>RE: Need Help with my HC 05 Bluetooth Pair (Master and slave)</title>
                        <link>https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13444</link>
                        <pubDate>Sat, 31 Oct 2020 16:34:01 +0000</pubDate>
                        <description><![CDATA[@gulshan
if I understand correctly you have managed to transmit and receive a value such as &#039;A&#039; or &#039;a&#039; between your arduino&#039;s but cannot see your way to using a potentiometer on one arduino...]]></description>
                        <content:encoded><![CDATA[<p><span>@gulshan</span></p>
<p>if I understand correctly you have managed to transmit and receive a value such as 'A' or 'a' between your arduino's but cannot see your way to using a potentiometer on one arduino to control a motor on an other arduino.</p>
<p>A potentiometer should be connected to an AD pin and can be made to read values from 0 to 1023 (assuming you use one of the Arduinos AD pins) as you increase the voltage through the potentiometer.  You can output this number to the serial monitor as well as using to control your servo motor.  (no doubt you have seen the excellent dronebot video on this).  Likewise you can transmit this number just as you did when you sent the 'A' or 'a' values.   Then at the receiving arduino end you take this number and use it to  control the attached motor.</p>
<p>As you have not submitted any code in relation to this, its not clear a what point along this chain you might be stuck at.</p>
<blockquote data-userid="1178" data-postid="13291" data-mention="gulshan">
<div class="wpforo-post-quote-author"><strong> Posted by: @gulshan </strong></div>
<p>is it just like the normal code</p>
</blockquote>
<p>yes, nothing special, and what with your transmit and receive code and the code in the dronebot article you are almost there. 😀 </p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/project-help/">Project Corner</category>                        <dc:creator>byron</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13444</guid>
                    </item>
				                    <item>
                        <title>RE: Need Help with my HC 05 Bluetooth Pair (Master and slave)</title>
                        <link>https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13435</link>
                        <pubDate>Sat, 31 Oct 2020 09:07:28 +0000</pubDate>
                        <description><![CDATA[@gulshan
Your transmitter code appears to suffer from the same issues as a recent post to which I have replied to... as for your receiver code, there is nothing wrong with it, but I&#039;d like ...]]></description>
                        <content:encoded><![CDATA[<p>@gulshan</p>
<p>Your transmitter code appears to suffer from the same issues as a recent post to which I have replied to... as for your receiver code, there is nothing wrong with it, but I'd like to suggest an alternative if it doesn't hinder your design goals:</p>
<p>For example, from this:</p>
<pre>    <span style="color: #00979c">char</span> <span style="color: #000000">val</span> <span style="color: #434f54">=</span> <strong><span style="color: #d35400">Serial</span></strong><span style="color: #434f54">.</span><span style="color: #d35400">read</span><span style="color: #000000">(</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
    <span style="color: #5e6d03">if</span><span style="color: #000000">(</span><span style="color: #000000">val</span> <span style="color: #434f54">==</span> <span style="color: #00979c">'A'</span><span style="color: #000000">)</span>
    <span style="color: #000000">{</span>
      <span style="color: #d35400">digitalWrite</span><span style="color: #000000">(</span><span style="color: #000000">led</span><span style="color: #434f54">,</span> <span style="color: #00979c">HIGH</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
    <span style="color: #000000">}</span>
    <span style="color: #5e6d03">else</span> <span style="color: #5e6d03">if</span><span style="color: #000000">(</span><span style="color: #000000">val</span> <span style="color: #434f54">==</span> <span style="color: #00979c">'a'</span><span style="color: #000000">)</span>
    <span style="color: #000000">{</span>
      <span style="color: #d35400">digitalWrite</span><span style="color: #000000">(</span><span style="color: #000000">led</span><span style="color: #434f54">,</span> <span style="color: #00979c">LOW</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
    <span style="color: #000000">}</span>
</pre>
<p>To this:</p>
<pre>   <span style="color: #00979c">String</span> ledS<span style="color: #000000">tate</span> <span style="color: #434f54">=</span> <strong><span style="color: #d35400">Serial</span></strong><span style="color: #434f54">.</span><span style="color: #d35400">readStringUntil</span><span style="color: #000000">(</span><span style="color: #00979c">'\n'</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
   
   <span style="color: #5e6d03">if</span><span style="color: #000000">(ledS</span><span style="color: #000000">tate</span><span style="color: #434f54">.</span><span style="color: #d35400">equals</span><span style="color: #000000">(</span><span style="color: #005c5f">"on"</span><span style="color: #000000">)</span><span style="color: #000000">)</span> <span style="color: #000000">{</span>
      <span style="color: #d35400">digitalWrite</span><span style="color: #000000">(</span><span style="color: #000000">led</span><span style="color: #434f54">,</span> <span style="color: #00979c">HIGH</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
    <span style="color: #000000">}</span>
   <span style="color: #5e6d03">else</span> <span style="color: #5e6d03">if</span><span style="color: #000000">(ledS</span><span style="color: #000000">tate</span><span style="color: #434f54">.</span><span style="color: #d35400">equals</span><span style="color: #000000">(</span><span style="color: #005c5f">"off"</span><span style="color: #000000">)</span><span style="color: #000000">)</span> <span style="color: #000000">{</span>
      <span style="color: #d35400">digitalWrite</span><span style="color: #000000">(</span><span style="color: #000000">led</span><span style="color: #434f54">,</span> <span style="color: #00979c">LOW</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
    <span style="color: #000000">}</span>
</pre>
<p>The reason I am providing this alternative, is because to often, code can become very unreadable, not only to oneself, but to others who try to interpret it.  I think it's much better to state the intent of the code, rather than taking shortcuts with single letter acronyms for variables, etc... programming languages are written to accommodate readable code, and that means you can in the end, include less comments too.</p>
<p>Given that this example is to turn an led on or off, doesn't it make sense to actually write the program code to reflect the intent of the actions desired?</p>
<p>It does not take anymore time to write the example I provided over your original.  If this code was to be used in MQTT for a light switch, wouldn't it be better to read "on" or "off" vs "A" or "a"?</p>
<p>I know which on I would choose every time... just some food for thought :-)</p>
<p>As for your Bluetooth question, you haven't provided any code for that at all, so like the big <span>@spyder, I'm a little confused too.  I have never worked with Bluetooth, so not sure I can really help with that, but unless I see some code and any associated error messages I won't know for sure, nor will anyone else.</span></p>
<p>Have you tried any of the library examples to start with, and if so, what were the errors?</p>
<p>Cheers.</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/project-help/">Project Corner</category>                        <dc:creator>frogandtoad</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13435</guid>
                    </item>
				                    <item>
                        <title>RE: Need Help with my HC 05 Bluetooth Pair (Master and slave)</title>
                        <link>https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13391</link>
                        <pubDate>Thu, 29 Oct 2020 07:32:50 +0000</pubDate>
                        <description><![CDATA[@spyderYes it is possible to control two bt devices with android phone but i don&#039;t want to use android phone for it.I want to make it Permanent. i just want to keep it as single master with ...]]></description>
                        <content:encoded><![CDATA[<p>@spyderYes it is possible to control two bt devices with android phone but i don't want to use android phone for it.I want to make it Permanent. i just want to keep it as single master with buttons and pot as transmitter communicating with slave that has led and a few servos as reciever.</p>
<p> </p>
<p>I made the code to control leds using button on the uno which works as a toggle switch and turns led on off through BT devices but I am unable to control the servo with pot. Here below the code that i made to control led using bt devices wirelessly.</p>
<p><span style="text-decoration: underline"><strong>Transmitter </strong></span></p>
<p> </p>
<pre><span style="color: #5e6d03">#define</span> <span style="color: #000000">button</span> <span style="color: #000000">2</span>
<span style="color: #00979c">int</span> <span style="color: #000000">value</span> <span style="color: #434f54">=</span> <span style="color: #000000">0</span><span style="color: #000000">;</span>
<span style="color: #00979c">void</span> <span style="color: #5e6d03">setup</span><span style="color: #000000">(</span><span style="color: #000000">)</span> <span style="color: #000000">{</span>
  <span style="color: #434f54">// put your setup code here, to run once:</span>
  <strong><span style="color: #d35400">Serial</span></strong><span style="color: #434f54">.</span><span style="color: #d35400">begin</span><span style="color: #000000">(</span><span style="color: #000000">9600</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
  <span style="color: #d35400">pinMode</span><span style="color: #000000">(</span><span style="color: #000000">button</span><span style="color: #434f54">,</span> <span style="color: #00979c">INPUT_PULLUP</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
<span style="color: #000000">}</span>

<span style="color: #00979c">void</span> <span style="color: #5e6d03">loop</span><span style="color: #000000">(</span><span style="color: #000000">)</span> <span style="color: #000000">{</span>
  <span style="color: #434f54">// put your main code here, to run repeatedly:</span>
  <span style="color: #00979c">int</span> <span style="color: #d35400">val</span> <span style="color: #434f54">=</span> <span style="color: #d35400">digitalRead</span><span style="color: #000000">(</span><span style="color: #000000">button</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
  <span style="color: #5e6d03">if</span><span style="color: #000000">(</span><span style="color: #d35400">val</span> <span style="color: #434f54">==</span> <span style="color: #000000">0</span> <span style="color: #434f54">&amp;&amp;</span> <span style="color: #000000">value</span> <span style="color: #434f54">==</span> <span style="color: #000000">0</span><span style="color: #000000">)</span>
  <span style="color: #000000">{</span>
    <strong><span style="color: #d35400">Serial</span></strong><span style="color: #434f54">.</span><span style="color: #d35400">println</span><span style="color: #000000">(</span><span style="color: #005c5f">"A"</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
    <span style="color: #000000">value</span> <span style="color: #434f54">=</span> <span style="color: #000000">1</span><span style="color: #000000">;</span>
    <span style="color: #d35400">delay</span><span style="color: #000000">(</span><span style="color: #000000">200</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
  <span style="color: #000000">}</span>
  <span style="color: #5e6d03">else</span> <span style="color: #5e6d03">if</span><span style="color: #000000">(</span><span style="color: #d35400">val</span> <span style="color: #434f54">==</span> <span style="color: #000000">0</span> <span style="color: #434f54">&amp;&amp;</span> <span style="color: #000000">value</span> <span style="color: #434f54">==</span> <span style="color: #000000">1</span><span style="color: #000000">)</span>
  <span style="color: #000000">{</span>
    <strong><span style="color: #d35400">Serial</span></strong><span style="color: #434f54">.</span><span style="color: #d35400">println</span><span style="color: #000000">(</span><span style="color: #005c5f">"a"</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
    <span style="color: #000000">value</span> <span style="color: #434f54">=</span> <span style="color: #000000">0</span><span style="color: #000000">;</span>
    <span style="color: #d35400">delay</span><span style="color: #000000">(</span><span style="color: #000000">200</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
  <span style="color: #000000">}</span>
  <span style="color: #d35400">delay</span><span style="color: #000000">(</span><span style="color: #000000">200</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
<span style="color: #000000">}</span>
<br /><span style="text-decoration: underline"><strong>Receiver</strong></span> <br /><br /><br />
<span style="color: #5e6d03">#define</span> <span style="color: #000000">led</span> <span style="color: #000000">2</span>

<span style="color: #00979c">void</span> <span style="color: #5e6d03">setup</span><span style="color: #000000">(</span><span style="color: #000000">)</span> 
<span style="color: #000000">{</span>
  <span style="color: #434f54">// put your setup code here, to run once:</span>
  <strong><span style="color: #d35400">Serial</span></strong><span style="color: #434f54">.</span><span style="color: #d35400">begin</span><span style="color: #000000">(</span><span style="color: #000000">9600</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
  <span style="color: #d35400">pinMode</span><span style="color: #000000">(</span><span style="color: #000000">led</span><span style="color: #434f54">,</span> <span style="color: #00979c">OUTPUT</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
<span style="color: #000000">}</span>

<span style="color: #00979c">void</span> <span style="color: #5e6d03">loop</span><span style="color: #000000">(</span><span style="color: #000000">)</span> 
<span style="color: #000000">{</span>
  <span style="color: #434f54">// put your main code here, to run repeatedly:</span>
  <span style="color: #5e6d03">if</span><span style="color: #000000">(</span><strong><span style="color: #d35400">Serial</span></strong><span style="color: #434f54">.</span><span style="color: #d35400">available</span><span style="color: #000000">(</span><span style="color: #000000">)</span><span style="color: #000000">)</span>
  <span style="color: #000000">{</span>
    <span style="color: #00979c">char</span> <span style="color: #d35400">val</span> <span style="color: #434f54">=</span> <strong><span style="color: #d35400">Serial</span></strong><span style="color: #434f54">.</span><span style="color: #d35400">read</span><span style="color: #000000">(</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
    <span style="color: #5e6d03">if</span><span style="color: #000000">(</span><span style="color: #d35400">val</span> <span style="color: #434f54">==</span> <span style="color: #00979c">'A'</span><span style="color: #000000">)</span>
    <span style="color: #000000">{</span>
      <span style="color: #d35400">digitalWrite</span><span style="color: #000000">(</span><span style="color: #000000">led</span><span style="color: #434f54">,</span> <span style="color: #00979c">HIGH</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
    <span style="color: #000000">}</span>
    <span style="color: #5e6d03">else</span> <span style="color: #5e6d03">if</span><span style="color: #000000">(</span><span style="color: #d35400">val</span> <span style="color: #434f54">==</span> <span style="color: #00979c">'a'</span><span style="color: #000000">)</span>
    <span style="color: #000000">{</span>
      <span style="color: #d35400">digitalWrite</span><span style="color: #000000">(</span><span style="color: #000000">led</span><span style="color: #434f54">,</span> <span style="color: #00979c">LOW</span><span style="color: #000000">)</span><span style="color: #000000">;</span>
    <span style="color: #000000">}</span>
  <span style="color: #000000">}</span>
<span style="color: #000000">}</span>

</pre>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/project-help/">Project Corner</category>                        <dc:creator>Gulshan</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13391</guid>
                    </item>
				                    <item>
                        <title>RE: Need Help with my HC 05 Bluetooth Pair (Master and slave)</title>
                        <link>https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13386</link>
                        <pubDate>Wed, 28 Oct 2020 22:50:32 +0000</pubDate>
                        <description><![CDATA[I&#039;m not sure I&#039;m understanding your question, but, I do know that connecting a phone to 2 BT devices is possible, but tricky
Why do you want to use 2 arduinos ?
Is this for 2 separate loca...]]></description>
                        <content:encoded><![CDATA[<p>I'm not sure I'm understanding your question, but, I do know that connecting a phone to 2 BT devices is possible, but tricky</p>
<p>Why do you want to use 2 arduinos ?</p>
<p>Is this for 2 separate locations ?</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/project-help/">Project Corner</category>                        <dc:creator>Spyder</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13386</guid>
                    </item>
				                    <item>
                        <title>RE: Need Help with my HC 05 Bluetooth Pair (Master and slave)</title>
                        <link>https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13373</link>
                        <pubDate>Wed, 28 Oct 2020 16:46:55 +0000</pubDate>
                        <description><![CDATA[Can anyone help me out]]></description>
                        <content:encoded><![CDATA[<p>Can anyone help me out </p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/project-help/">Project Corner</category>                        <dc:creator>Gulshan</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13373</guid>
                    </item>
				                    <item>
                        <title>Need Help with my HC 05 Bluetooth Pair (Master and slave)</title>
                        <link>https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13291</link>
                        <pubDate>Sat, 24 Oct 2020 13:53:34 +0000</pubDate>
                        <description><![CDATA[Hello, Recently I have been trying to make a 4 door mechanism which consists of 4 servo motors that are operated by potentiometer using arduino.
but Now I want to make it wireless using my ...]]></description>
                        <content:encoded><![CDATA[<p>Hello, Recently I have been trying to make a 4 door mechanism which consists of 4 servo motors that are operated by potentiometer using arduino.</p>
<p>but Now I want to make it wireless using my HC 05 master/slave bluetooth pair. I wanted to keep the connection binded and secured to only one master module so i didn't used phone bluetooth for it but i dont know how to control servos using two HC 05 bluetooth modules between two arduino by potentiometer. Can anyone help me with it.</p>
<p>is it just like the normal code ?</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/project-help/">Project Corner</category>                        <dc:creator>Gulshan</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/project-help/need-help-with-my-hc-05-bluetooth-pair-master-and-slave/#post-13291</guid>
                    </item>
							        </channel>
        </rss>
		