I bought Seeed BLE Shield I would like to connect via android phone to check the status of an analog input. I tried to download HMBLEComAssistant.apk but does not work on my phone. Can I write an android application to connect to Seeed BLE Shield? I did not understand how to connect to the device. I have tried to discover the device but to no avail (the same test also from a linux pc).
HMBLEComAssistant.apk works but only receive message don’t send. i have tested this code:
#include <SoftwareSerial.h> //Software Serial Port #define RxD 2 #define TxD 3
SoftwareSerial BLE(RxD,TxD);
void setup() {
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
pinMode(RxD, INPUT);
pinMode(TxD, OUTPUT);
setupBleConnection();
}
void loop() {
char recvChar;
while(1){
if(BLE.available()){//check if there’s any data sent from the remote BLE shield
recvChar = BLE.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();
BLE.print(recvChar); //Serial.print(recvChar);
}
}
}
void setupBleConnection(){
BLE.begin(9600); //Set BLE BaudRate to default baud rate 9600
BLE.print(“AT+CLEAR”); //clear all previous setting
BLE.print(“AT+ROLE0”); //set the bluetooth name as a slaver
BLE.print(“AT+SAVE1”); //don’t save the connect information*/
}
I use arduino leonardo (1.5 and arduino ide serial monitor), If I send a message from the serial monitor that is received by Assistant.apk but if I try to send the message to HMBLEComAssistant.apk don’t works. even if I try to change pin BLE_RX don’t works.
Any Suggestions? I have made many attempts but without success.