Arduino Bluetooth receive data and save it in a variable with the lliberia

Hi there
I am doing a project in which I need to send data from the mobile to Arduino with bluetooth, with the #include <SoftwareSerial.h> liberia, and then save it in a variable to be able to make comparisons. I can't do it, ja has been with this problem for more than a week. Can someone help me please.

Thank you

At the moment it took this code but it does not work:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2,3); //RX i TX

int Word;
int Valor;

void setup() {
Serial.begin(9600);
mySerial.begin(9600);
pinMode(10, OUTPUT);
}

void loop() {
while (mySerial.available()) {
if (mySerial.available() > 0) {
Valor = mySerial.read();
Word = Valor;
}
}
Serial.println(Word);

}

Which Arduino and Bluetooth module are you using ?

Please follow the advice on posting code given in Read this before posting a programming question

In particular note the advice to Auto format code in the IDE and to use code tags when posting code here as it prevents some combinations of characters in code being interpreted as HTML commands such as italics, bold or a smiley character, all of which render the code useless

If the code exceeds the 9000 character inline limit then attach it to a post

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.