Hi everyone! I am new to the this BT communication Ok, my end goal is to connect my android phone via the Arduino Commander app to my arduino board that is controlling different motors. I have purchased the seeedstudio BT Shield, gone to their website for instructions, read through the Wiki (and did everything it says to do), searched online for videos or simple instruction guides (no luck) and canāt get it to connect through the SSCOM3.2 app provided on the Wiki(which worries me because I am not even going to be connecting through that software, I will be connecting through my phone). I changed the code (see Wiki seeedstudio.com/wiki/index.p ā¦ oth_Shield) as instructed for the latest version of Arduino and the sketch uploads to the board. After that, the SSCOM3.2 should let me know that the BT sheild is inquireable (I am trying to set as slave) but it does nothing. (One thing to note, on the wiki, the ComNum on the middle right side of SSCOM3.2 is COM156ā¦ mine is empty, I donāt think I set up something correctly but canāt find instrcution on the Wiki)
I am looking for instructions, or a starting point to read up more on connecting via BT. It would be great to talk to someone who has used the seeedstudio BT shield and had it work correclty. Any help is better than I have now Thanks.
[code]/*
BluetoothShield Demo Code Slave.pde. This sketch could be used with
Master.pde to establish connection between two Arduino. It can also
be used for one slave bluetooth connected by the device(PC/Smart Phone)
with bluetooth function.
2011 Copyright Ā© Seeed Technology Inc. All right reserved.
Author: Steve Chang
This demo code is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
For more details about the product please check http://www.seeedstudio.com/depot/
*/
/* Upload this sketch into Seeeduino and press reset*/
// old line: #include <NewSoftSerial.h> //Software Serial Port
#include <SoftwareSerial.h> //new line
#define RxD 6
#define TxD 7
#define DEBUG_ENABLED 1
// old line: NewSoftSerial blueToothSerial(RxD,TxD);
SoftwareSerial blueToothSerial(RxD,TxD); //new line
void setup()
{
Serial.begin(9600);
pinMode(RxD, INPUT);
pinMode(TxD, OUTPUT);
setupBlueToothConnection();
}
void loop()
{
char recvChar;
while(1){
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);
}
}
}
void setupBlueToothConnection()
{
blueToothSerial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
blueToothSerial.print("\r\n+STWMOD=0\r\n"); //set the bluetooth work in slave mode
blueToothSerial.print("\r\n+STNA=SeeedBTSlave\r\n"); //set the bluetooth name as āSeeedBTSlaveā
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
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();
}
[/code]