Take the 2-minute tour ×
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

I am trying to get my Arduino UNO to communicate with a Bluetooth Module (Bluetooth Bee), but I am getting a weird behaviour from the device. First, there are no leds blinking on the board (which I think there should be). Second, every time I send an AT command to the board I get ERROR: (0) which apparently is the caused by an invalid AT command, but it happens as I am sending just "AT" which should return "OK".

The Arduino code:

#include <SoftwareSerial.h>
SoftwareSerial BT(10,11); 

void setup()  {

    BT.begin(38400);
    Serial.begin(9600);
    BT.print("\r\n+AT");
}

char a; // stores incoming character from other device

void loop() {

    if (BT.available())  { 
        a=(BT.read());
        if (a=='\n') Serial.println((char)(a));
        else Serial.print((char)(a));

    }

}
share|improve this question
    
The default serial baud rate is 9600 - you have changed it? If not, try setting the arduino rate to 9600 instead of 38400. –  Mark Williams Jul 27 at 10:01
    
I am sending just "AT" . It seems you are actually sending +AT. I'd also try moving the \r\n to the end of the string, instead of the beginning. –  Gerben Jul 27 at 12:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.