Hi,
I am trying to connect my computer to arduino uno using the HC-05 bluetooth module. I am trying receive data from my computer to the arduino and print it to the serial monitor. Here is my code:
#include <SoftwareSerial.h>
int bluetoothTx = 2; //TX-O pin of HC05
int bluetoothRx = 3; //Rx-I pin of HC05
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
void setup() {
// put your setup code here, to run once:
bluetooth.begin(9600);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if(bluetooth.available())
{
Serial.println(bluetooth.read());
}
if(Serial.available())
{
bluetooth.println(Serial.read());
}
}
I tried using putty and Tera Term to send data after connecting my computer to the bluetooth module. Now whenever I press a character key in Tera Term, I'm getting 254 printed on the serial monitor and when I press a number I get 255 on the serial monitor. I'm not able to get the Ascii character I sent. Can anyone help in finding the issue?