Skip to main content
//add enum for easy reading during seting
enum btnMode {On, Off, Hide};
enum btnsPos { TopLeft, TopRight, BottomLeft, BottomRight, CentreBottom };

//define any functions you may use so the compiler will know you will declare them latter
extern void tesfunction();
extern int  returnsAnInteger();

//define the Action pointer to function with no variable
typedef void (* Action) ();

//define the struct on your array
struct tsButton {
  btnMode   Status;
  btnsPos   Position;
  char      Text[12];
  int       Xtop;
  int       Ytop;
  int       Width;
  int       Height;
  int       xLimit;
  int       yLimit;
  Action    action;
  uint8_t   *Icon;

//declare and set
const tsButton Help = { On, CentreBottom, "Help", 450, 530, 90, 90, 540, 530, tesfunction, (uint8_t *)&houricon_data };
//this must be down in setup if your function is defined later in your project or you can tell the compiler you will define the function later see above for how to do that
//houricon_data is the array of the image included in the project after base64 encoding and importing
displayImage(houricon[1250]) // as an example


When testing make your tesfunction (intentional spelling mistake) very simple e.g. Serial.println("It worked");

as it makes it easier to debug