My project requires for me to both receive and transmit data using Bluetooth (HC-06). While I have no trouble in transmitting data from my laptop onto arduino via serial monitor and bluetooth, I have problems when trying to transmit data from Android handphone onto arduino which will then transmits towards the laptop and display at serial monitor.
The current code that I am using declares two serials in the beginning
This work for Intel Galileo. Reading further on the topic, I found that method is unusable for Uno since it only has 1 RX and TX pin. Can anybody help or confirm this? If so, any suggestion would be greatly appreciated. Thanks.
Izzy13:
Just to paraphase,by applying the Softwareserial library I will be able to talk to HC-06?
Yes. You use the USB cable on Serial for the Serial monitor, and the stated pins in the example for Bluetooth. This is a pretty dumb exercise, where Arduino is essentially just a redundant middleman, but it does prove the point by enabling you to send data from serial monitor to phone.
Thanks for all the suggestions! Per your advice, I tried softwareserial library as given by the Arduino webpage Software Serial
And sure enough, I can transmit data from serial monitor to arduino. However I have some confusion. I assuming it is via bluetooth? However, the HC-06 is connected to my android handphone. How does that work?
Also, looking back, I think I got my topic wrong. 'Is there anyway to transmit data from android handphone to HC-06 via bluetooth' would have been a more accurate title. I downloaded two different applications (Blueterm and SerialBluetoothTerminal) and both can be connected to the HC-06. Yet, it still cannot send data/command to Arduino Uno. Can anybody help?
Izzy13:
And sure enough, I can transmit data from serial monitor to arduino. However I have some confusion. I assuming it is via bluetooth?
No, it isn't, and never will be. Bluetooth is for connecting Arduino to Android.
However, the HC-06 is connected to my android handphone. How does that work?
By doing what it is supposed to do.
Also, looking back, I think I got my topic wrong. 'Is there anyway to transmit data from android handphone to HC-06 via bluetooth' would have been a more accurate title.
That doesn't matter. If it works one way it will work the other, and any terminal will do. If you want to use software serial, the example in the software serial library should suffice. Read replies #5,#8 again.