Hello , I am using my nextus 7 tablet and both blueterm and bluetooth spp both work. I have included my sw below that will show what you send on a lcd so you can see what you do send ....
#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
SoftwareSerial mySerial(3, 2); // RX, TX
#define text
#define text=myserial
void setup()
{
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);//added
// Open serial communications and wait for port to open:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
mySerial.begin(115200);
mySerial.println("test comms");
delay(500);
}
void loop()
{
if (Serial.available())
delay(100);
mySerial.write(Serial.read());
delay(500);
lcd.clear();
if (mySerial.available())
lcd.write(mySerial.read());
}
Peter1929 thank you very much ! I have not yet tested your code but I think that it is the same as a code that I found and worked for me.
Here it is :
char val;
int ledpin = 8;
#include <SoftwareSerial.h>
#define BT_SERIAL_TX_DIO 10
#define BT_SERIAL_RX_DIO 11
SoftwareSerial BluetoothSerial(BT_SERIAL_TX_DIO, BT_SERIAL_RX_DIO);
void setup(){
pinMode(ledpin, OUTPUT);
Serial.begin(9600);
BluetoothSerial.begin(9600);
}
void loop() {
if(BluetoothSerial.available()){
val = BluetoothSerial.read();}
if( val == 'H' ){
digitalWrite(ledpin, HIGH);}
else {
digitalWrite(ledpin, LOW);}
}
However I would like to ask you some thing else. As you can see at the code I gave it
the ability when receives a character to execute a command (at this case to power a led).
The problem I have is that when I change the text from 'H' to 'HA' , this does not work.Why this happens and what can I do to make it work ?