user30432: I recently ordered an HC-06 Bluetooth module for my Arduino Uno, and after watching this video, and many others, I still have been having many issues figuring out how to get it to work, and some questions for how the code receives and reads serial data from my phone.

I assume this wiring is correct, right?

Rx  > Tx 
Tx  > Rx 
Gnd > Gnd 
Vcc > 3.3V

When I sent a command over the Bluetooth terminal app I have, the serial monitor displays that command over and over, I assume that is correct also?
How do I read the serial input? I've been using 
if(Serial.available() > 0)
        phoneInput = (char) Serial.read();

and then displaying the value of phoneInput to the serial monitor, but for some reason I can't seem to have it control anything properly (in this case an LED)
What datatype is the Serial.read() returning to my variable before I cast char on to it?
I get errors uploading the code to the board (avrdude: stk500_recv(): programmer is not responding), until I remove the pin connected to the Rx on the arduino, is there a cleaner solution to uploading the board without unplugging wires?


user4143: 
I assume this wiring is correct, right?
Rx > Tx
Tx > Rx
Gnd > Gnd
Vcc > 3.3V


Almost. The Arduino's TX should be reduced to 3.3V using a 10k/20k potential divider.

How do I read the serial input? I've been using
if(Serial.available() > 0)
       phoneInput = (char) Serial.read();


You should read and digest this.

What datatype is the Serial.read() returning to my variable before I cast char on to it?

An integer. It holds either 0-255 representing the ASCII code for a character, or -1 if there is nothing in the buffer to read.

I get errors uploading the code to the board (avrdude: stk500_recv(): programmer is not responding), until I remove the pin connected to the Rx on the arduino, is there a cleaner solution to uploading the board without unplugging wires?

That will be because you are using pins 0/1 to communicate with the bluetooth which you can't do because those are used to communicate with the PC.

30432: <p>I recently ordered an HC-06 Bluetooth module for my Arduino Uno, and after watching <a href="https://www.youtube.com/watch?v=F6E5mP70jaw&amp;t=1s" rel="nofollow noreferrer">this video</a>, and many others, I still have been having many issues figuring out how to get it to work, and some questions for how the code receives and reads serial data from my phone.</p>

<ol>
<li><p>I assume this wiring is correct, right?</p>

<ul>
<li>Rx  > Tx </li>
<li>Tx  > Rx </li>
<li>Gnd > Gnd </li>
<li>Vcc > 3.3V</li>
</ul></li>
<li><p>When I sent a command over the Bluetooth terminal app I have, the serial monitor displays that command over and over, I assume that is correct also?</p></li>
<li><p>How do I read the serial input? I've been using </p>

<pre><code>if(Serial.available() &gt; 0)
        phoneInput = (char) Serial.read();
</code></pre>

<p>and then displaying the value of phoneInput to the serial monitor, but for some reason I can't seem to have it control anything properly (in this case an LED)</p></li>
<li><p>What datatype is the Serial.read() returning to my variable before I cast char on to it?</p></li>
<li><p>I get errors uploading the code to the board (avrdude: stk500_recv(): programmer is not responding), until I remove the pin connected to the Rx on the arduino, is there a cleaner solution to uploading the board without unplugging wires?</p></li>
</ol>
 4143: <blockquote>
  <p>I assume this wiring is correct, right?</p>

<pre><code>Rx &gt; Tx
Tx &gt; Rx
Gnd &gt; Gnd
Vcc &gt; 3.3V
</code></pre>
</blockquote>

<p>Almost. The Arduino's TX should be reduced to 3.3V using a 10k/20k potential divider.</p>

<blockquote>
  <p>How do I read the serial input? I've been using</p>

<pre><code>if(Serial.available() &gt; 0)
       phoneInput = (char) Serial.read();
</code></pre>
</blockquote>

<p>You should read and digest <a href="https://hackingmajenkoblog.wordpress.com/2016/02/01/reading-serial-on-the-arduino/" rel="nofollow noreferrer">this</a>.</p>

<blockquote>
  <p>What datatype is the Serial.read() returning to my variable before I cast char on to it?</p>
</blockquote>

<p>An integer. It holds either 0-255 representing the ASCII code for a character, or -1 if there is nothing in the buffer to read.</p>

<blockquote>
  <p>I get errors uploading the code to the board (avrdude: stk500_recv(): programmer is not responding), until I remove the pin connected to the Rx on the arduino, is there a cleaner solution to uploading the board without unplugging wires?</p>
</blockquote>

<p>That will be because you are using pins 0/1 to communicate with the bluetooth which you can't do because those are used to communicate with the PC.</p>
