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?
Basically, what I'm trying to do is to send a message from the phone and print it in the Serial Monitor and to send a message from the Serial Monitor and print it on the phone
Also, to pair the HC-06 with the phone and exchange messages I am using Bluetooth Terminal application from the Play Store.
Cross-posted at softwareserial - Arduino Pro Mini Serial Monitor garbage - Arduino Stack Exchange. Please don't do that. It wastes people's time due to duplicate effort trying to help you. You could at least have posted links to the other posts. The problem has already been solved on Stack Exchange but how would people here know that they don't need to spend time helping you with a question that has already been answered.
I'm really sorry about that. As you can see, the answers came in pretty quickly and for some reasons I did not get any e-mails so I did not know that people already answered.
Next time I'll know better and I'll post links to the stackoverflow question as well.
I will test their solutions and I'll let everyone know if everything works fine.
Thanks,
Andrei
Unfortunately, those answers did not help me at all
I configured the HC-06 but I still do not get anything printed on the Android phone application.
So..back to square one.
To answer your question, this is what I get when I open the Serial Monitor in the Arduino IDE with this code :
Newline, Baud rate 9600
‚Ƈ¥Ç$¤†Fó
If I change the Serial Monitor properties to Newline, Baud rate 19200 this is what I receive :
Hello from Serial
On the Android phone application I do not get anything printed.
It appears that in fact your board is not running at 8MHz, but instead 16MHz. Please select the correct setting for your board: Tools > Processor > ATmega328(5V, 16MHz)
Or if it has the ATmega168: Tools > Processor > ATmega168(5V, 16MHz)