This is my first post. I hope that I am posting in the right section of the forum. Otherwise, could an admin move this topic to the appropriate section please?
Board : Arduino Pro Mini 3.3V 8MHz
Arduino IDE : 1.6.12
Arduino is powered by a FTDI Board and USB Mini-B cable from the computer USB port in the following order :
Arduino FTDI
BLK GND
GND CTS
VCC VCC
RXi TX
TXo RX
DTR DTR
Also, I have connected a HC-06 bluetooth module in the following order :
Arduino HC-06
GND GND
VCC VCC
D10 RXD
D11 TXD
The Serial Monitor is open on COM4, Newline, 9600 baud.
The code that I'm trying to run is :
#include <SoftwareSerial.h>
SoftwareSerial BT(10, 11);
void setup()
{
pinMode(13, OUTPUT);
BT.begin(9600);
// Send test message to other device
BT.println("Hello from BTSerial");
Serial.begin(9600);
Serial.println("Hello from Serial");
}
char a; // stores incoming character from other device
void loop()
{
if (BT.available())
// if text arrived in from BT serial...
{
a=(BT.read());
if (a=='1')
{
digitalWrite(13, HIGH);
BT.println("LED on");
}
if (a=='2')
{
digitalWrite(13, LOW);
BT.println("LED off");
}
if (a=='?')
{
BT.println("Send '1' to turn LED on");
BT.println("Send '2' to turn LED on");
}
Serial.println(a);
}
}
I am trying to communicate with the HC-06 from an Android phone.
I am posting in this section of the forum because when I send a message from the phone to Arduino the following is printed in the Serial Monitor :
à„…€ƒ¦¤„„‡…§¤¦„‡Å„EóAãbBãbHãb
When I am trying to send a message from Arduino to the phone, nothing is received on the phone.
Could someone please explain why I get garbage output on the Serial Monitor even though the baud rate is the same in the code as it is in Serial Monitor window?
Is there a problem with the Arduino IDE?