1

Topic: Can someone do a test ....

.... I have no hardware at the present time to test this on.

I am about to embark on a project that will have a "matrix" of many buttons.

I am thinking that I may be able to use "Row" and "Column" buttons, intersecting at the places where I want a single button (like a keypad, for instance).

But I need to know whether overlapping buttons both get turned on when touched.

I've done a simple mock-up of the idea - http://remotexy.com/en/editor/5bd016603 … 0ff64f0a0/ where 3 LEDs are controlled by only two buttons - extend this idea to many buttons, and the overheads are drastically reduced.

Feel free to break it apart, it's only two buttons, overlapping behind the pseudo-button B.

The code should be trivial to test it works. 

LED_A should light up if button_AB AND NOT button_BC
LED_B should light up if button_AB AND button_BC
LED_C should light up if button_BC AND NOT button_AB

If anyone could spare the time to give this a test I would be grateful...

TIA

Oops, forgot to include the code ....

 -- Test Request --
   
   This source code of graphical user interface 
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 2.4.3 or later version 
   download by link http://remotexy.com/en/library/
   To connect using RemoteXY mobile app by link http://remotexy.com/en/download/                   
     - for ANDROID 4.5.1 or later version;
     - for iOS 1.4.1 or later version;
    
   This source code is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.    
*/

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__SOFTSERIAL
#include <SoftwareSerial.h>

#include <RemoteXY.h>

// RemoteXY connection settings 
#define REMOTEXY_SERIAL_RX 2
#define REMOTEXY_SERIAL_TX 3
#define REMOTEXY_SERIAL_SPEED 9600


// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,2,0,3,0,121,0,10,13,0,
  1,2,15,33,45,13,2,31,0,1,
  2,39,33,45,13,2,31,0,65,4,
  18,12,10,10,65,4,44,12,10,10,
  65,4,70,12,10,10,130,0,14,30,
  70,17,13,129,0,29,14,4,6,24,
  65,0,129,0,55,14,4,6,24,66,
  0,129,0,81,14,4,6,24,67,0,
  130,1,17,33,12,11,30,130,1,43,
  33,12,11,30,130,1,69,33,12,11,
  30,129,0,21,36,4,6,24,65,0,
  129,0,47,36,4,6,24,66,0,129,
  0,73,36,4,6,24,67,0 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t button_AB; // =1 if button pressed, else =0 
  uint8_t button_BC; // =1 if button pressed, else =0 

    // output variables
  uint8_t led_A_r; // =0..255 LED Red brightness 
  uint8_t led_B_r; // =0..255 LED Red brightness 
  uint8_t led_C_r; // =0..255 LED Red brightness 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////



void setup() 
{
  RemoteXY_Init (); 
  
  
  // TODO you setup code
  
}

void loop() 
{ 
  RemoteXY_Handler ();
  
  
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay() 


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

2 (edited by Edvard 2020-12-09 00:37:18)

Re: Can someone do a test ....

Hi,
   it works as you expected. There is only one issue - it looks like in web editor on Andrioid smartphone only. On iPhone looks totally different - all panels (big green and smaller grey) are below orange buttons and black texts. Looks ugly.

3

Re: Can someone do a test ....

Edvard wrote:

Hi,
   it works as you expected. There is only one issue - it looks like in web editor on Andrioid smartphone only. On iPhone looks totally different - all panels (big green and smaller grey) are below orange buttons and black texts. Looks ugly.

Thanks Edvard for doing this.....

So the layering as designed does not work on the iPhone - that's not good news.

It might be because the "panel" covering the orange buttons, takes least priority, so will always be rendered first.

Odd then that it works OK on Android, but not on iOS.

I have modified it such that the "panel" hiding the buttons is an LED. This might cure the problem. I can always colour the LED the same as the screen background, and it has the added bonus that an LED doesn't have to show a border.

I wonder if you'd try this for me ......

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__SOFTSERIAL
#include <SoftwareSerial.h>

#include <RemoteXY.h>

// RemoteXY connection settings 
#define REMOTEXY_SERIAL_RX 2
#define REMOTEXY_SERIAL_TX 3
#define REMOTEXY_SERIAL_SPEED 9600


// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,2,0,6,0,120,0,10,13,0,
  1,2,15,33,45,13,2,31,0,1,
  2,39,33,45,13,2,31,0,65,4,
  18,12,10,10,65,4,44,12,10,10,
  65,4,70,12,10,10,129,0,29,14,
  4,6,24,65,0,129,0,55,14,4,
  6,24,66,0,129,0,81,14,4,6,
  24,67,0,65,31,13,30,72,17,130,
  1,17,33,12,11,30,130,1,43,33,
  12,11,30,130,1,69,33,12,11,30,
  129,0,21,36,4,6,24,65,0,129,
  0,47,36,4,6,24,66,0,129,0,
  73,36,4,6,24,67,0 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t button_AB; // =1 if button pressed, else =0 
  uint8_t button_BC; // =1 if button pressed, else =0 

    // output variables
  uint8_t led_A_r; // =0..255 LED Red brightness 
  uint8_t led_B_r; // =0..255 LED Red brightness 
  uint8_t led_C_r; // =0..255 LED Red brightness 
  uint8_t led_1_r; // =0..255 LED Red brightness 
  uint8_t led_1_g; // =0..255 LED Green brightness 
  uint8_t led_1_b; // =0..255 LED Blue brightness 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////



void setup() 
{
  RemoteXY_Init (); 
  
// set the led colour same as the background colour
led_1_r =  1;
led_1_g = 154;
led_1_b = 145;

}

void loop() 
{ 
  RemoteXY_Handler ();
  
  
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay() 
2B, or not 2B, that is the pencil ...

4

Re: Can someone do a test ....

Hi,
   some change but not a solution. Now on iOS grey buttons and black texts are not visible. Generally layering on iOS doesn't work good.

BTW. Would you mind taking a look on bug regarding HM-10 / serial communication (http://forum.remotexy.com/viewtopic.php?id=1206)?

5

Re: Can someone do a test ....

Edvard wrote:

Generally layering on iOS doesn't work good.

BTW. Would you mind taking a look on bug regarding HM-10 / serial communication (http://forum.remotexy.com/viewtopic.php?id=1206)?

done ....

iOS layering - not good, considering you have to keep paying for the license !

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

6

Re: Can someone do a test ....

I have replaced the gray panels and text fields with buttons, and on the face of it, that would defeat the object of trying to reduce the GUI and data size using rows and columns.

But get this, the three buttons I have put on are all called "button_1", but it allows me to put different labels on them !!

Now this means, of course, that I have 3 entries in my data interface, but as I don't need these buttons, I'm wondering if I can simply remove them ????   EDIT : see the code, I've left one in, or the phone app may not like them all removed, and see the comment about the remaining one might be useful a a "button press detection".....

Could you try this code please .....

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__SOFTSERIAL
#include <SoftwareSerial.h>

#include <RemoteXY.h>

// RemoteXY connection settings 
#define REMOTEXY_SERIAL_RX 2
#define REMOTEXY_SERIAL_TX 3
#define REMOTEXY_SERIAL_SPEED 9600


// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,5,0,6,0,102,0,10,13,0,
  1,2,15,33,45,13,2,31,0,1,
  2,39,33,45,13,2,31,0,65,4,
  18,12,10,10,65,4,44,12,10,10,
  65,4,70,12,10,10,129,0,29,14,
  4,6,24,65,0,129,0,55,14,4,
  6,24,66,0,129,0,81,14,4,6,
  24,67,0,65,31,13,30,72,17,1,
  1,18,33,12,12,0,8,65,0,1,
  1,43,33,12,12,0,8,66,0,1,
  1,68,33,12,12,0,8,67,0 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t button_AB; // =1 if button pressed, else =0 
  uint8_t button_BC; // =1 if button pressed, else =0 

  // don't need these buttons, but probably need one only, or the app will baulk
  // Actually, it might be a useful button - to trigger the decode of the hidden 
  // "row" & "column" buttons that will be beneath it : no point calling the
  // decode routine unless a "button press" is detected ....
  uint8_t button_1; // =1 if button pressed, else =0 
  //uint8_t button_1; // =1 if button pressed, else =0 
  //uint8_t button_1; // =1 if button pressed, else =0 

    // output variables
  uint8_t led_A_r; // =0..255 LED Red brightness 
  uint8_t led_B_r; // =0..255 LED Red brightness 
  uint8_t led_C_r; // =0..255 LED Red brightness 

// this LED just covers the AB and BC buttons, we do nothing with it except 
// initialise it to same as background colour in setup();
  uint8_t led_1_r; // =0..255 LED Red brightness 
  uint8_t led_1_g; // =0..255 LED Green brightness 
  uint8_t led_1_b; // =0..255 LED Blue brightness 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////



void setup() 
{
  RemoteXY_Init (); 
  
// LED "panel"  covers the AB and BC buttons
led_1_r = 1;
led_1_g = 154;
led_1_b = 145'
  
}

void loop() 
{ 
  RemoteXY_Handler ();
  
  
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay() 


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