I have ESP8266 with HC-05 Bluetooth module .
I needed to send large data from ESP8266 to my Android app(wireless).
Firstly Both HC-05 and ESP connected together and write a code in ESP8266(As below).
Here i am sent a small data from ESP8266 to Android app(like "S2 Terminal for Bluetooth").
How can i send a structure data(contains multiple informations) from ESP8266?
Please give me some examples..
Thanks.
#include "BluetoothSerial.h" //Header File for Serial Bluetooth, will be added by default into Arduino
BluetoothSerial ESP_BT; //Object for Bluetooth
int incoming;
int LED_BUILTIN = 2;
void setup() {
Serial.begin(9600); //Start Serial monitor in 9600
ESP_BT.begin("ESP32_LED_Control"); //Name of your Bluetooth Signal
Serial.println("Bluetooth Device is Ready to Pair");
pinMode (LED_BUILTIN, OUTPUT);//Specify that LED pin is output
}
void loop() {
if (ESP_BT.available()) //Check if we receive anything from Bluetooth
{
incoming = ESP_BT.read(); //Read what we recevive
Serial.print("Received:"); Serial.println(incoming);
if (incoming == 49)
{
digitalWrite(LED_BUILTIN, HIGH);
ESP_BT.println("LED turned ON");
}
if (incoming == 48)
{
digitalWrite(LED_BUILTIN, LOW);
ESP_BT.println("LED turned OFF");
}
}
delay(20);
}