Hello guys,
I am working on project that require communication between Android device and bluetooth module
I am using arduino mega 2560 and Bluetooth 4.0 BLE HM-10 module
I connected pins in this way:
Vcc__________ 3.3V
GND_________ GND
TXD_________ RX3 (15)
RXD_________ TX3 (14)
I am using this code:
// Arduino Bluetooth modul HM-10
#define RX 14
#define TX 15
#define pinLED 13
#include <SoftwareSerial.h>
SoftwareSerial bluetooth(TX, RX);
void setup() {
bluetooth.begin(9600);
bluetooth.println("setting up");
Serial.begin(9600);
Serial.println("setting up.");
pinMode(pinLED, OUTPUT);
}
void loop() {
byte BluetoothData;
bluetooth.println("test");
if (bluetooth.available() > 0)
{
BluetoothData = bluetooth.read();
Serial.println(BluetoothData);
}
delay(100);
}
I am using "Serial Bluetooth Terminal" as Android application to read and write messages to bluetooth mudule
It says "device is connected" and receive data from module (test, test, test ...)
But the module does not receive data and if i want to communicate with module by serial port for example writing "AT?" nothing is happening
in console is set 9600b and NL & CR which requires this module