Hello,
I'm tryoing to connect from my PI4 to the Arduino using HC05.
basic led on\off by sending "1""0" from the pi.
I have connected the HC05 to the Arduino
TX-> Rx
RX-> Tx
Vcc - 5V
Gnd- GND
the HC05 is blinking , when I scan I can see it from my phone\python code
98:D3:C1:AA:8B:22 - HC-05
but I can't connect to it
also I can't see anything in the Serial Monitor
2 questions:
- do I need to change something in the HC05 defualt setting (I just took it out of the box and start using it , didn't change any setting using AT command)
- is the code correct?
/*
Bluetooh Basic: LED ON OFF - Avishkar
Coder - Mayoogh Girish
Website - http://bit.do/Avishkar
Download the App :
This program lets you to control a LED on pin 13 of arduino using a bluetooth module
*/
char Incoming_value = 0; //Variable for storing Incoming_value
void setup()
{
Serial.begin(9600); //Sets the data rate in bits per second (baud) for serial data transmission
pinMode(13, OUTPUT); //Sets digital pin 13 as output pin
Serial.println("Setup Finish!");
}
void loop()
{
if (Serial.available() > 0)
{
Incoming_value = Serial.read(); //Read the incoming data and store it into variable Incoming_value
Serial.print(Incoming_value); //Print Value of Incoming_value in Serial monitor
Serial.print("\n"); //New line
if (Incoming_value == '1') //Checks whether value of Incoming_value is equal to 1
digitalWrite(13, HIGH); //If value is 1 then LED turns ON
else if (Incoming_value == '0') //Checks whether value of Incoming_value is equal to 0
digitalWrite(13, LOW); //If value is 0 then LED turns OFF
}
else
{
Serial.println("No Data");
}
}
all I get is No Data
Thanks,