i want to use arduino mega 2560 and bluetooth module hc 06. i connected
hc o6 5v->arduino 5v pin
gnd-> arduino gnd pin
rx-> arduino tx3(14) pin
tx-> arudino rx3(15) pin
and i programmed like this.
void setup() {
Serial.begin(9600);
Serial1.begin(38400);
Serial.println("ATcommand"); //ATcommand Start
}
void loop() {
if (Serial1.available())
Serial.write(Serial1.read());
if (Serial.available())
Serial1.write(Serial.read());
}
You have to connect your BT module to pin 18/19.
Remember this is just a forwarder sketch, it doesn't do anything itself. You should think about increasing the baud rate of the serial connection to the PC to the same value you use on the bluetooth.