71Views2Replies

Author Options:

bluetooth sheild library Answered

I have created a library for bluetooth sheild . but its showing some errors while compiling .. plz help me

.h file

class BlueTooth
{
public:
BlueTooth(int Rxd, int Txd);
void setupBlueToothConnection();

private:
int _Rxd;
int _Txd;
};



.cpp file

BlueTooth::BlueTooth(int Rxd, int Txd)
{
  pinMode(RxD,INPUT);
  pinMode(TxD,OUTPUT);
  _Rxd = Rxd;
  _Txd = Txd;
}


void BlueTooth::setupBlueToothConnection()
{
  blueToothSerial.begin(9600); //Set BluetoothBee BaudRate to default baud rate 38400
  blueToothSerial.print("AT+ROL=0\r\n"); //set the bluetooth work in slave mode
  blueToothSerial.print("AT+NAME=slave\r\n"); //set the bluetooth name as "Slave"
  blueToothSerial.print("AT+PSWD=1234\r\n"); // DEFAULT PASSWORD = 1234
  blueToothSerial.print("AT+CMOD=1\r\n"); // CONNECT TO ANY ADDRESS
  delay(2000); // This delay is required.
  blueToothSerial.print("AT+INQ\r\n"); //make the slave bluetooth inquirable
  Serial.println("The slave bluetooth is inquirable!");
  delay(2000); // This delay is required.
  blueToothSerial.flush();
}

Tags:library

Comments

The forums are retiring in 2021 and are now closed for new topics and comments.
0
kelseymh
kelseymh

8 years ago

Moved to Forums:Tech.

Please update your text above to include a description of what you think your code is supposed to do (in text, not just reading the source), and also a description of what it actually does (or doesn't do :-) when you use it.

0
steveastrouk
steveastrouk

8 years ago

"Bugs" refers to site problems, not your source code !
Try posting it in the questions section.

No-one will help you unless you post some comments about WHAT bugs you have