Several days ago I purchased a bluetooth module HC-06 for arduino board. I have link it together with my arduino uno and copy/paste sample code but the problem is that I don't get any response via Serial Monitor. Here is code, any idea what is wrong?
#include <SoftwareSerial.h>
SoftwareSerial bluetooth(4, 2);
void setup()
{
Serial.begin(9600); // Begin the serial monitor at 9600bps
bluetooth.begin(9600); // Start bluetooth serial at 9600
}
void loop()
{
if(bluetooth.available()) // If the bluetooth sent any characters
{
// Send any characters the bluetooth prints to the serial monitor
Serial.print((char)bluetooth.read());
}
if(Serial.available()) // If stuff was typed in the serial monitor
{
// Send any characters the Serial monitor prints to the bluetooth
bluetooth.print((char)Serial.read());
}
// and loop forever and ever!
}
Indeed I'm sure they are the wrong way round but don't panic - no harm will be done. Similarly, a 3.3v HC-06 is a very rare device indeed. It pays to check, but probably no harm done there either.
I don't know if HC-06 will pair with IOS, but it will not work with it.