1 (edited by Proto PCB 2022-12-21 15:42:25)

Topic: How to find out which page in the app is currently displayed?

Hi!

I want to create an app that achieves the same result using different controllers - placed on different pages.

To achieve this, I need a variable informing which page is currently active in the app. Something like “RemoteXY.pageID = 0”, etc.

I don't see any other way to accomplish this. Please give me tips.

If such a feature does not exist, can you add it?


Regards!
Patryk Szulczewski


App in use

2

Re: How to find out which page in the app is currently displayed?

This feature is currently missing. We are working on it.

3

Re: How to find out which page in the app is currently displayed?

As a workaround, until the Page features are enhanced, you can place buttons behind the Page buttons, and interrogate with your sketch.

As an example, here I have 3 Pages, each with 15 buttons on. All of the pages have the same buttons, meaning I can decode 45 buttons using just 18 interface variables.

void loop() {
RemoteXY_Handler();

if(RemoteXY.Page_Button_1) Page_Number = 0;
if(RemoteXY.Page_Button_2) Page_Number = 1;
if(RemoteXY.Page_Button_3) Page_Number = 2;
if(RemoteXY.button_1) Button_Number = 1;
if(RemoteXY.button_2) Button_Number = 2;
if(RemoteXY.button_3) Button_Number = 3;
if(RemoteXY.button_4) Button_Number = 4;
if(RemoteXY.button_5) Button_Number = 5;
if(RemoteXY.button_6) Button_Number = 6;
if(RemoteXY.button_7) Button_Number = 7;
if(RemoteXY.button_8) Button_Number = 8;
if(RemoteXY.button_9) Button_Number = 9;
if(RemoteXY.button_10) Button_Number = 10;
if(RemoteXY.button_11) Button_Number = 11;
if(RemoteXY.button_12) Button_Number = 12;
if(RemoteXY.button_13) Button_Number = 13;
if(RemoteXY.button_14) Button_Number = 14;
if(RemoteXY.button_15) Button_Number = 15;

RemoteXY.Button_No = (Page_Number * Buttons_Per_Page) + Button_Number;

switch(RemoteXY.Button_No) {
  case 1:  // button_1 on page 1
  [do something here]
  break;
|
|
|
switch(RemoteXY.Button_No) {
  case 45: // button_15 on page 3
  [do something here]
  break;


etc ....

RemoteXY.Button_No is calculated as 1-15 for the buttons on page 1, 16 to 30 for the buttons on page 2, and 31-45 for the buttons on page 3

Make your buttons same size ans shape as the Page buttons, and don't forget to "Send to Back"

HTH

2B, or not 2B, that is the pencil ...