It is not a good idea to work with Bluetooth on two screens since the connection is lost when moving from one to another.
Normally virtual screens are used (two VerticalArrangement)...
11.- Virtual Screen with two VerticalArrangement.
p9A0i_bluetooth_virtual.aia (4.1 KB)
[bt_29]
In this example I have used Send1ByteNumber, I have arbitrarily chosen the numbers 153,168,221.
Arduino returns a byte 48 or 49.
[bt_30]
// Juan A. Villalpando
// http://kio4.com/appinventor/9A0_Resumen_Bluetooth.htm
#define LED13 13
byte StatusLED13;
void setup()
{
Serial.begin(9600);
pinMode(LED13, OUTPUT);
}
void loop() {
if(Serial.available())
{
int dato = Serial.read();
…
If you want to try it with two Screen, try...
28. Bluetooth in Screen1 and Screen2.
p9H4i_pantalla_real_BT.aia (8.7 KB)
When we change from Screen1 to Screen2, we lose the Bluetooth connection.
The proper method to avoid this is to use "virtual screens" with VerticalArrangement as we saw in the post: #12
Now let's see how we can go from Screen1 to Screen2 using the disconnection and connection in the new Screen.
To go from one Screen to another, we disconnect the current connection, when we start the visible Screen we reconnect.
I've …
1 Like