To open another screen using arduino

I’m a newbie here. How can I code to make it the apps open another screen when the IR sensor senses a blockage. I had connected it with Bluetooth, and it successful.

Hi Amirah

You have done the most difficult stuff, well done. To make another Screen Open is easy.

When you change Screens, the Bluetooth connection will be lost. If you don’t want that to happen, use Virtual Screens instead. (See FAQ).

1 Like

Excuse me sir, may i know why it open the new screen directly, even there is no blockage on the IR sensor?

…It’s because the receipt of data is used as the trigger. So, depends on your Arduino Sketch. Sounds like it sends more information than just confirming a blockage detection? If it does, then read the data and only trigger a Screen Change accordingly.

This code sequence is very fishy.

What kind of piece of text passes an if test?

You are right ABG, had my head in the wrong programming language at the time :upside_down_face:

Amirah, try this correction:

may i know, does it work to use multiple IR sensors to open multiple screens. It’s mean, 1st ir sensor will open screen A, and 2nd ir sensor open screen B. and i had do virtual screen.


Yes - Simply have a seperate Bluetooth Block set for the 2nd Screen, so you have a dedicated bluetooth ‘channel’ for each sensor.

…alternatively, code the signals so that an If - Then can be used to determine which screen to open.