Hi everyone,
I’m trying to use a Bluetooth module ([SMD module) with an Arduino board.
What I have in my ‘project’ is :
-
a Bluetooth dongle because my laptop is not Bluetooth built-in,
-
a Bluetooth module which is linked to my Arduino board,
-
an Arduino board (ATmega 328, 5V/16MHz)
My Bluetooth module and my Arduino board are linked together as shown on [that.
I’m able on my software to read what is sent from my Arduino board thanks to the Bluetooth communication. That is not a problem.
The problem I have now is to read a data in my Arduino from my software using the Bluetooth communication.
My software must read and send messages and my Arduino must send and read messages.
In my software in VB Express 2010, I use a SerialPort tool to set up communication between my laptop and the Bluetooth module.
I just put the code below in a button to send the value to my Bluetooth module :
OutSerialPort.Open()
If OutSerialPort.IsOpen Then
OutSerialPort.Write(True)
End If
OutSerialPort.Close()
And on my Arduino board, there is another program that normally turn on a LED when it sees True from the Bluetooth module.
boolean fromComputer;
void setup() {
Serial.begin(9600);
pinMode(13, OUTPUT);
digitalWrite(13, LOW);}
void loop() {
if (Serial.available() > 0) {
fromComputer = Serial.read();
if (fromComputer == true) {
digitalWrite(13, HIGH);
delay(1000);
}
else {
digitalWrite(13, LOW);
}
delay(1000);
}
}
Both programs works with a USB wire in both way : Arduino to Laptop and Laptop to Arduino,
But with a Bluetooth module, the communication seems to be possible in only one way (Arduino to Laptop).
So, have you already had this problem with a Bluetooth module ?
Normally, if my programs work with USB, they must work with a Bluetooth module, mustn’t they ?
For me, the Bluetooth module is like a USB wire, it’s just a way of communication, so maybe I need to use another settings that I didn’t use before ?
In VB Express 2010, there are few settings that could be useful (or not) like RtsEnable, DrtEnable, …
On the Bluetooth module, there are few pins not used yet like Reset, ReadyToSend, ClearToSend, …
Help me , anything can be useful :idea: .
(And I’m french, so if someone wants to speak french, that’s ok for me :D)](Bluetooth Module (Device) | Hobbyist.co.nz)](Bluetooth SMD Module - SparkFun - WRL-08474 - SparkFun Electronics)