Hi!
First of all, my english level is quite limited so i'm sorry if something is written wrong.
I'm trying to "program" an app to control a motor with a joystick using appinventor2.
When i test it with a basic Arduino code to watch the x and y variations on the Serial Monitor everything is going well until 1 minute later the app suddenly stops running and a "Broken pipe" error is shown.
I've been reading in many forums and it seems to be a problem related to bluetooth connection but i don't know how to solve it.
Maybe the main problem comes from the baud rate of HC - 05 module, so I'd like to know the needed configuration and if it could be the problem.
I've attached the appivnentor2 blocks.
Here's my Arduino code:
void setup() {
Serial.begin(38400);
}
void loop() {
if (Serial.available() >= 1) {
int x = Serial.read();
delay(25); //Don't know if that is necessary
int y = Serial.read();
Serial.print("x:");
Serial.print(x);
Serial.print("\n");
Serial.print("y:");
Serial.print(y);
Serial.print("\n");
}
}
Thanks!