I have successfully connected my two bluetooth mate silver modules to one another, these are connected to two Arduino pro minis respectively. I send an oscillatory binary value from the slave to the master, this triggers an LED to turn on/off as this data is received. The issue I am facing is that the devices’ COM ports are occupied when this is happening (signalled by a green light on the Bluetooth modules) and as such, I cannot extract data from the master to the PC. I would like to know if the Bluetooth mate silver is capable of SENDING DATA TO THE COMPUTER WHEN IN MASTER/SLAVE MODE?
This is the Bluetooth module embedded in my pc: Qualcomm Atheros QCA9377 Bluetooth 4.1
I have attached my code below.
//MASTER
String slaveMAC = “000666FB9C03”;
int led = 10;
int val = 0;
void setup()
{
Serial.begin(57600);
Serial.print(“$$$”); // enter command mode
delay(100);
Serial.println(“SU,57”); // set baud rate to 57600
delay(100);
Serial.println(“C,” + slaveMAC + “\r”); // connect to slave device
delay(100);
Serial.println(“SM,1”); // set device to master
delay(100);
//Serial.println(“—,” + slaveMAC + “\r”); // exit command mode, enter data mode
Serial.println(“—\r\n”); // exit command mode, enter data mode
delay(100);
pinMode(led,OUTPUT);
digitalWrite(led,HIGH);
}
void loop()
{
if(Serial.available() > 0)
{
val = Serial.read();
}
if(val == ‘1’)
{
digitalWrite(led,HIGH);
Serial.println(“Hello”);
val = 0;
}
else if(val == ‘0’)
{
digitalWrite(led,LOW);
val = 0;
}
delay(10);
}
//SLAVE
String masterMAC = “000666EBE858”;
int val = 20;
void setup()
{
Serial.begin(57600);
Serial.print(“$$$”); // enter command mode
delay(100);
Serial.println(“SU,57”); // set baud rate to 57600
delay(100);
Serial.println(“C,” + masterMAC + “\r”); // connect to slave device
delay(100);
Serial.println(“SM,0”); // set device to slave
delay(100);
Serial.println(“—\r\n”); // exit command mode, enter data mode
delay(100);
}
void loop()
{
if(Serial.available() > 0)
{
val = Serial.read();
}
Serial.println(‘1’);
delay(1000);
Serial.println(‘0’);
delay(1000);
}