Skip to content
This repository has been archived by the owner on Dec 20, 2021. It is now read-only.

button_pressed

Mammad900 edited this page Aug 29, 2020 · 1 revision

button_pressed[page][index]

Summary

Returns true if a button was pressed.

Parameters

  1. Page (int) : The number of the page which contains the button
  2. Index (int) : The index of the button relative to the page

Returns

True if the button is enabled, visible and being touched. Else, false.

Examples

//In loop()
if(button_pressed[0][1]){ //The second button in the first page
    Serial.println("Clicked!");
}

Prints 'Clicked!' to serial monitor repeatedly while the button is being touched

//In loop()
if(button_pressed[2][0]){ //The first button in the third page
    Serial.println("Clicked!")
    while(button_pressed[2][0])checkPage(); // Wait until the button is released
}

Prints 'Clicked!' to serial monitor and waits until the button is released

Clone this wiki locally