Please post code so we can help you.... or try this code this is what works for me you can add your code after the line that says....blueToothSerial.print(recvChar);
}
Code: #include <SoftwareSerial.h> //Software Serial Port #define RxD 6 #define TxD 7 #define DEBUG_ENABLED 1 SoftwareSerial blueToothSerial(RxD,TxD); void setup() { Serial.begin(9600); pinMode(RxD, INPUT); pinMode(TxD, OUTPUT); setupBlueToothConnection(); } void loop() { char recvChar; if(blueToothSerial.available()){//check if there's any data sent from the remote bluetooth shield recvChar = blueToothSerial.read(); Serial.print(recvChar); } if(Serial.available()){//check if there's any data sent from the local serial terminal, you can add the other applications here recvChar = Serial.read(); blueToothSerial.print(recvChar); } // ADD YOUR CODE HERE } void setupBlueToothConnection() { blueToothSerial.begin(115200); //Set BluetoothBee BaudRate to (115200) the default baud rate is 38400 blueToothSerial.print("\r\n+STWMOD=0\r\n"); //set the bluetooth work in slave mode blueToothSerial.print("\r\n+STNA=SeedBT\r\n"); //set the bluetooth name as "SeedBT" blueToothSerial.print("\r\n+STOAUT=1\r\n"); // Permit Paired device to connect me blueToothSerial.print("\r\n+STAUTO=0\r\n"); // Auto-connection should be forbidden here blueToothSerial.print("\r\n+STPIN=0000\r\n");//set pin to 0000 blueToothSerial.print("\r\n+RTPIN=0000\r\n");// ask to input pin delay(2000); // This delay is required. blueToothSerial.print("\r\n+INQ=1\r\n"); //make the slave bluetooth inquirable Serial.println("The slave bluetooth is inquirable!"); delay(2000); // This delay is required. blueToothSerial.flush(); }if this code doesnt work when uploaded to arduino with bt/module then there may be other issues. Post back success or failure and will try to help further
Statistics : Posted by reebbhaa • on Mon Apr 22, 2013 3:47 am • Replies 15 • Views 2029