Go Down

Topic: ERRO IN SERIAL bluettoth program (Read 329 times) previous topic - next topic

nstm91

Mar 08, 2013, 08:35 am Last Edit: Mar 08, 2013, 12:14 pm by nstm91 Reason: 1
i instil library of  newSoftSerial in arduino lib...
and try to verify serial program but it display some error



and it display this error

In file included from serial.ino:4:
C:\Documents and Settings\suresh\My Documents\Arduino\libraries\GSM_Shield/NewSoftSerial.h:71: error: conflicting return type specified for 'virtual void NewSoftSerial::write(uint8_t)'
I:\arduino-1.5.2-windows\arduino-1.5.2\hardware\arduino\avr\cores\arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'


and attach code here...

AWOL

The code you posted is Processing.

Please use code tags when posting code.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

AWOL

Code: [Select]
#include <SoftwareSerial.h>
#define RxD 2
#define TxD 3

SoftwareSerial blueToothSerial(RxD,TxD);

void setup()
{
    Serial.begin(9600);          //Serial port for debugging, Comment this line if not required 
    pinMode(RxD, INPUT);
    pinMode(TxD, OUTPUT);
    setupBlueToothConnection();
}

void loop()
{
  if(blueToothSerial.read() == 'a')
  {
    blueToothSerial.println("You are connected to Bluetooth Bee");
    //You can write you BT communication logic here
  }
}

void setupBlueToothConnection()
{
    Serial.print("Setting up Bluetooth link");       //For debugging, Comment this line if not required   
    blueToothSerial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
    delay(1000);
    sendBlueToothCommand("\r\n+STWMOD=0\r\n");
    sendBlueToothCommand("\r\n+STNA=modem\r\n");
    sendBlueToothCommand("\r\n+STAUTO=0\r\n");
    sendBlueToothCommand("\r\n+STOAUT=1\r\n");
    sendBlueToothCommand("\r\n+STPIN=0000\r\n");
    delay(2000); // This delay is required.
    blueToothSerial.print("\r\n+INQ=1\r\n");
    delay(2000); // This delay is required.
    Serial.print("Setup complete");

}

void sendBlueToothCommand(char command[])
{
    char a;
    blueToothSerial.print(command);
    Serial.print(command);                          //For debugging, Comment this line if not required   
    delay(3000);

    while(blueToothSerial.available())              //For debugging, Comment this line if not required 
    {                                               //For debugging, Comment this line if not required   
       Serial.print(char(blueToothSerial.read()));  //For debugging, Comment this line if not required 
    }                                               //For debugging, Comment this line if not required   
}
compiling gave the error message
Quote

Binary sketch size: 4984 bytes (of a 14336 byte maximum)
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

nstm91


i instil library of  newSoftSerial in arduino lib...
and try to verify serial program but it display some error



and it display this error

In file included from serial.ino:4:
C:\Documents and Settings\suresh\My Documents\Arduino\libraries\GSM_Shield/NewSoftSerial.h:71: error: conflicting return type specified for 'virtual void NewSoftSerial::write(uint8_t)'
I:\arduino-1.5.2-windows\arduino-1.5.2\hardware\arduino\avr\cores\arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'


and attach code here...

Code: [Select]


#include <NewSoftSerial.h>   //Software Serial Port
#define RxD 2
#define TxD 3

NewSoftSerial blueToothSerial(RxD,TxD);

void setup()
{
    Serial.begin(9600);          //Serial port for debugging, Comment this line if not required 
    pinMode(RxD, INPUT);
    pinMode(TxD, OUTPUT);
    setupBlueToothConnection();

}

void loop()
{

  if(blueToothSerial.read() == 'a')
  {
    blueToothSerial.println("You are connected to Bluetooth Bee");
    //You can write you BT communication logic here
  }
}

void setupBlueToothConnection()
{
    Serial.print("Setting up Bluetooth link");       //For debugging, Comment this line if not required   
    blueToothSerial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
    delay(1000);
    sendBlueToothCommand("\r\n+STWMOD=0\r\n");
    sendBlueToothCommand("\r\n+STNA=modem\r\n");
    sendBlueToothCommand("\r\n+STAUTO=0\r\n");
    sendBlueToothCommand("\r\n+STOAUT=1\r\n");
    sendBlueToothCommand("\r\n+STPIN=0000\r\n");
    delay(2000); // This delay is required.
    blueToothSerial.print("\r\n+INQ=1\r\n");
    delay(2000); // This delay is required.
    Serial.print("Setup complete");

}

void sendBlueToothCommand(char command[])
{
    char a;
    blueToothSerial.print(command);
    Serial.print(command);                          //For debugging, Comment this line if not required   
    delay(3000);

    while(blueToothSerial.available())              //For debugging, Comment this line if not required 
    {                                               //For debugging, Comment this line if not required   
       Serial.print(char(blueToothSerial.read()));  //For debugging, Comment this line if not required 
    }                                               //For debugging, Comment this line if not required   
}



Go Up