Hi, i’m using CC2541 bluetooth with Atmega 2560 and i send msg from Serial Terminal app android to Serial of Arduino, otherwise, i can’t know how i can send data from Arduino to Android Serial Terminal and receive this data in a variable, by example.
Someone have it? How?
This is code to send data from android to arduino:
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(11, 10); // RX | TX
void setup()
{
pinMode(13, OUTPUT); // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
digitalWrite(13, HIGH);
Serial.begin(9600);
Serial.println("Enter AT commands:");
BTSerial.begin(9600); // HC-05 default speed in AT command more
}
void loop()
{
// Continue lendo o HC-05 e envie para o Arduino Serial Monitor
if (BTSerial.available())
Serial.write(BTSerial.read());
// Continue lendo no Arduino Serial Monitor e envie para o HC-05
if (Serial.available())
BTSerial.write(Serial.read());
}