Sending information by hc-05 to an orther arduino

Hey,
I’m trying to build a rc car using my own controler, for that I’m using 2 bluetooth modules the HC-05.
The probleme that I have is that when I’m sending, for example, a 123 I received a 56 49 10.

Here are the code that i’m using.
The modules are configure.

Master_Code_BT.ino (121 Bytes)

Slave_Code_BT.ino (155 Bytes)

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

The three numbers you are receiving are the Ascii codes for the characters '8' '1' and linefeed. If you define your variable State as char they will print out as characters.

You are sending data too frequently. For testing add delay(500); into your Master code.

...R

Thank's a lot for your help now it work, I'm just wandering if you can replace a "const byte" by "#define" ?

XavierMarquet: Thank's a lot for your help now it work, I'm just wandering if you can replace a "const byte" by "#define" ?

You can as long as the type of the number does not matter. The compiler will assume numbers are int by default.

...R