AppInventor2- How to freeze Display-Value?
Previous reading is overwritten!
I am working on an Android-Arduino Interface to communicate and send at least 10 different values in both directions.
I am reading with the Android-Phone the Ports of an Arduino Mega2560. On the Serial-Port 1 is a BTM220 Bluetooth-Module.
The Phone sends for reading each Port of the Arduino the characters ‚a‘ for Port A, ‚b‘ for the Port B and so on.
The Output on the Phone-Display is:
PortA= 0bxxxxxxxx,
PortB= 0bxxxxxxxx,
PortC= 0bxxxxxxxx
…….
The Arduino+BTM222 send the Port-Values as strings.
The Problem I have, is that the Phone-Bluetooth reading routine overwrites the screen of the Phone with new values even if I do not ask for any new values (the Phone is not sending any enquiry and the Arduino+BTM222 sends no values). That means that the Arduino does not send any new value, but the Phone-Bluetooth is already reading the next value. The result is that I see for 2 seconds (clock-Delay in the App-Inventor-Routine) the value I have asked for, but 2 seconds later these values are deleted (or overwritten with empty Strings??) while the phone is not asking for any new values from the Arduino
->from the Arduino are no values coming-> the BT sends no values to the phone, but in the phone are the old values deleted/overwritten)
Is there any possibility to “freeze” the first incoming values so that only if the phone sends a new enquiry(Click the Enquiry-Button) the old values will be with the new ones overwritten?
Please help!