Ok, so there were a few problems that are hard to see from above, so I will try to explain.
First of all, RX and TX on a Bluetooth card do not equal them on an arduino. They go to their opposites.
Example:
Bluetooth RX → TX on Arduino
Bluetooth TX → RX on Arduino
So, if you look at the Arduino photo above, it should be very obvious that pins 7 and 8 are the wrong location.
The next question I had was a poor connection.
In the above configuration, power and earth seem beautiful. However, you must connect the RX and TX connections. Otherwise, you will get a bad connection.
As soon as I did this, the above code worked flawlessly.
Hope this helps someone else to have these problems!
source share