ArduinoGeneral

Arduino Uno or Pro + Xbee Shield + Bluetooth Bee

userHead madfin 2013-04-04 07:02:20 7941 Views3 Replies
Hi...

I'm using Arduino Uno with xbee shield V.14 with Bluetooth Bee 2.0.

I try to test bidirectional communication between my pc (windows 7) and arduino with simple program to turn on/off the led in arduino pin 13 as posted in this forum [url=http://www.dfrobot.com/forum/index.php?topic=329.msg1327#msg1327]http://www.dfrobot.com/forum/index.php?topic=329.msg1327#msg1327[/url]


[code]


/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.

This example code is in the public domain.
*/


void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
Serial.begin(9600);
Serial.println(" Lets test the bluetooth module");
Serial.println("Press 1 to light the LED, and 2 to turn it off");
Serial.println("Entery: ");
digitalWrite(13, HIGH);
}


void loop() {
if (Serial.available()){
char input = Serial.read();
switch (input){
case '1': //turn led on
digitalWrite(13, HIGH); // set the LED on
delay(100); // wait for a second
Serial.println("it works on!!");
break;
case '2':
digitalWrite(13, LOW); // set the LED off
delay(100); // wait for a second
Serial.println("it works off!!");
break;
}
}
}
[/code]

I have no problem configuring bluetooth bee with AT command (take out the processor and manipulating switches) and succesfully establish connection between bluetooth bee with my pc.
I also manage to get feedback on the terminal screen (using putty or windows hyper terminal) as expected in the program but I cannot send the character "1" or "2" to turn on/off the led.

In general I can receive data transmitted from arduino via bluetooth to windows terminal but never succed send data to arduino. Please help what is the problem?

I believe my connection is correct and I try to change Arduino Uno (in case of compatibility issue) with Arduino Pro ..but with no success..same result...can receive data but cannot transmit data..
Btw, how to send data from windows hyperterminal or putty...is it just typing the character? in this case either "1" or "2"? Am I right?

Thanks in advance...
2013-04-10 04:53:12 Hi Angelo,

Thanks for the reply.
I found out the problem already. The voltage from Bluetooth Bee DOut drop at arduino rx terminal. Could be bad connection on two switches (USB-Xbee switch and Prog Switch) which could raise resistance.
I did short cable jumper from Bluetooth Bee Dout pin directly to Arduino Rx pin and...IT WORKS!!!.
userHeadPic madfin
2013-04-08 00:49:11 Perhaps the data is received from usb instead of bluetooth.
[url=https://www.dfrobot.com/wiki/index.php/Xbee_Shield_For_Arduino_(no_Xbee)_(SKU:DFR0015)#PinOut]https://www.dfrobot.com/wiki/index.php/Xbee_Shield_For_Arduino_(no_Xbee)_(SKU:DFR0015)#PinOut[/url]
There is a switch to select whether communicating with Xbee or USB.

Yes, just typing the character.
userHeadPic Angelo.Qiao
2013-04-05 19:35:05 Hi... please..anyone can help?

Thanks
userHeadPic madfin