Hello
I know this topic has been presented like 100 times from before but i'm have problem making the arduino talking to each other
What I'm trying to do is establish a connection between two Arduino by reading multiple sensor data from master and send to slave to able to see it in serial plot.
So far I was able to pair the two module in AT + model and the module are blinking one time every two second.
I try all the different example that was done from before but still without any luck
link that I tried so fat:
https://forum.arduino.cc/index.php?topic=386417.0
http://forum.arduino.cc/index.php?topic=318623.0
http://www.martyncurrey.com/connecting-2-arduinos-by-bluetooth-using-a-hc-05-and-a-hc-06-pair-bind-and-link/
http://forum.hobbycomponents.com/viewtopic.php?f=39&t=1567
what I'm doing right now after pairing the two module is trying this code below
// transmitter
// there's no button, it just sends every 2 secs.
#include<SoftwareSerial.h>
const int rxPin = 10;
const int txPin = 11;
//const int button = 2;
SoftwareSerial mySerial(rxPin,txPin);//RX,TX.
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
}
void loop()
{
mySerial.write("4");
delay (2000);
}
// receiver
#include<SoftwareSerial.h>
const int rxPin = 10;
const int txPin = 11;
SoftwareSerial mySerial(rxPin,txPin);//RX,TX.
byte packet;
void setup()
{
pinMode(13, OUTPUT);
Serial.begin(9600);
mySerial.begin(9600);
}
void loop()
{
if(mySerial.available != 0)
{
int inData = mySerial.read();
Serial.print("# ");
Serial.print(packet,DEC);
Serial,print(" ");
Serial.println(inData);
packet ++;
}
}
but still without any luck.
my module are connected to Arduino's in this way
Arduino 1:
PIN 10 - TX Bluetooth 1
PIN 11 - RX Bluetooth 1
GND -> GND of the other Arduino + Bluetooth 1
5V -> VCC Bluetooth 1
Arduino 2:
PIN 10 - TX Bluetooth 2
PIN 11 - RX Bluetooth 2
GND -> GND of the other Arduino, Bluetooth 2
5V -> VCC Bluetooth 2
I also change the Bluetooth band rate of two module to 9600 in AT+ model but did not get far
Can you please help me !!
