- Tue Jun 22, 2010 6:10 pm
#103652
I was wondering if anyone has a correct SPP AT command set for the BTM-182 bluetooth module. I tried using the command set provided but only get "ERROR" when trying to implement a command. When I send just the AT command it returns OK. How do i properly send AT commands to the bluetooth chip?
Code: Select all
#include <NewSoftSerial.h>
#define rxPin 2
#define txPin 3
NewSoftSerial BlueTooth(rxPin, txPin);
void setup()
{
Serial.begin(9600); //open serial hardware
BlueTooth.begin(19200); //open serial software
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
BlueTooth.print("AT\r"); //Communication returns OK
delay(1000);
}
void loop()
{
BlueTooth.print("ati0\r"); //Communication returns ERROR
while(BlueTooth.available()){
Serial.print((char)BlueTooth.read());
}
delay(1000);
BlueTooth.print("ati1\r"); //Communication returns ERROR
while(BlueTooth.available()){
Serial.print((char)BlueTooth.read());
}
delay(1000);
}
Last edited by Wiseman20 on Fri Jun 25, 2010 1:39 pm, edited 1 time in total.