Basic BT connection to Uno+HC05 & Smartphone

Hello, I am facing a problem to communicate between my smartphone and Arduino Uno.
I have an HC05 BT connected to an Uno and I can connect via BT on my Galaxy A8. I have a very simple application:

How do I check what I'm sending via button1 or button2?
The Arduino serial monitor never sees anything happening.
Very simple Arduino Code :

Any help ?
Thanks.

Hallo Vidalv,
your Arduino code shall use two different serial lines: one for the PC monitor and another one to communicate with the BT shield.
Since you are using a UNO board you need to use the Softwareserial library in order to map the second serial line on two digital pins (10/11 ; 2/3 or others). There is plenty of tutorials on the community. Do a search, you'll find surely the help you need. If you have still problems ask again.
Meilleures salutations,
Ugo.
PS: en pièce jointe tu peux trouver un fichier txt qui contient le logiciel en Arduino et un .aia que j'avais déjà développé pour un autre membre de la communauté. Ils doivent marcher. (je suis Italien donc mon Français est très pauvre..... :face_with_hand_over_mouth:)

Vidalv.txt (979 Bytes) Ruben.aia (65.1 KB)

Hallo Ugo, thank you, it's the truth, in fact I took a code with the application for the smartphone and I didn't look at the Arduino code. In fact, all the protocol for retrieving the chain of characters from the phone to the Uno is missing.
So it can't work !!!
I think by adding: SoftwareSerial mySerial (10, 11); for example I will be able to recover what is happening at the port of the HC05 .....
Thank you, it's a blunder!
Vincent.

Your code works. You can connect your module to pins 0 and 1 of Arduino.
Here a small modification of your code.

char incomingValue = 0;
int LED1 = 7;

void setup() {
Serial.begin(9600);
pinMode(LED1, OUTPUT); }

void loop() {
if(Serial.available() > 0){
incomingValue = Serial.read();
Serial.println(incomingValue);

if(incomingValue == '0'){
Serial.println("Valeur is 0");
digitalWrite(LED1,HIGH);
}

if(incomingValue == '1'){
Serial.println("Valeur is 1");
digitalWrite(LED1,LOW);
}
}
}

Thanks a lot Juan Antonio, using TX / RX of the Arduino its disables the ability to access the Serial Monitor, I prefer to create a dummy port (in my case Pin 10 and 11) so I can see what is happening.
Here is my code that works now!

Thank you for your support.
Vincent.

Hello Juan Antonio,
you can't use the PC monitor and the BT shield connected at the same port otherwise the PC can't download the software to the board. If you do so, you always have to disconnect the BT shield before downloading a new code to the UNO.
In my experience is far better to have the BT connected on a couple of available pins by using the SoftwareSerial (the only care to take is to avoid too fast baudrates: 38400 is good enough for many applications).
Futhermore any character sent on Serial will go both to the PC monitor and to the HC05, therefore is sent also to the BT sender. This can lead to a "confusion" on BT sender side (The BT sender receives the character sent to the Serial Monitor as an echo ...).
Cheers, Ugo.
.

@uskiara @vidalv

I commented on all that in this topic: