Hi all,
I am trying to build an app to communicate with my Bluno.
I can transmit Strings without any problems, but when I try to receive Strings, it shows me the last value I transmitted.
Attaching my blocks:
Here is the relevant part of my code:
#include <SoftwareSerial.h>
SoftwareSerial BTserial(0, 1); // RX, TX
void setup() {
Serial.begin(9600);
BTserial.begin(9600);
temp.begin();
}
void loop() {
Serial.println("Please insert the number of what you would like to do:"); //Prompt User for Input
Serial.println("1) Calibrations");
Serial.println("2) Measurments");
Serial.println("3) Measure all");
Serial.println();
userinput = UserInput();
....
else if (userinput.equals("3")) { // User is looking to measure all in at once
Serial.println("Starting to measure");
Serial.println();
// Temperature ,^C
userinput = UserInput();
Serial.println("Temp:");
Serial.println();
temperature = temp.readTemperature();
delay(5000);
char strFloat[8];
dtostrf(temperature, 2, 2, strFloat);
Serial.write(strFloat, strlen(strFloat));
BTserial.write(strFloat, strlen(strFloat));
}
}
// Function to read the user's input
char UserInput() {
while (BTserial.available() == 0) {}
char input = BTserial.read();
Serial.println(input);
return input;
}
I guess that my Arduino code is not writing to the characteristic UUID?
Any ideas on what can I do?