Syntaxe:
uint8_t read();
Description:
Paramètres:
Retour:
#include <M5Stack.h> void setup() { M5.begin(); M5.Lcd.println("Please pressed Button A."); } void loop() { M5.Lcd.setCursor(0, 0); M5.Lcd.printf("Button A Status: %d ",M5.BtnA.read()); }
Syntaxe:
uint32_t lastChange();
Description:
Paramètres:
Retour:
#include <M5Stack.h> void setup() { M5.begin(); M5.Lcd.println("Please pressed Button A."); } void loop() { M5.update(); M5.Lcd.setCursor(0, 0); M5.Lcd.printf("The last change at %d ms /n",M5.BtnA.lastChange()); }
Syntaxe:
uint8_t isPressed();
Description:
Paramètres:
Retour:
#include <M5Stack.h> void setup() { M5.begin(); M5.Lcd.println("Please pressed Button A."); } void loop() { M5.update(); M5.Lcd.setCursor(0, 0); if (M5.BtnA.isPressed()) { M5.Lcd.println("Button is Pressed."); }else{ M5.Lcd.println("Button is Released."); } delay(20); }
Syntaxe:
uint8_t wasPressed();
Description:
Paramètres:
Retour:
#include <M5Stack.h> void setup() { M5.begin(); M5.Lcd.println("Please pressed Button A."); } void loop() { M5.update(); if (M5.BtnA.wasPressed()) { M5.Lcd.println("Button is pressed."); } delay(20); }
Syntaxe:
uint8_t pressedFor(uint32_t ms);
Description:
Paramètres:
Retour:
#include <M5Stack.h> void setup() { M5.begin(); M5.Lcd.println("Please pressed Button A."); } void loop() { M5.update(); if (M5.BtnA.pressedFor(2000)) { M5.Lcd.println("Button A was pressed for more than 2 seconds."); delay(1000); } }
Syntaxe:
uint8_t isPressed();
Description:
Paramètres:
Retour:
#include <M5Stack.h> void setup() { M5.begin(); } void loop() { M5.update(); if (M5.BtnA.isReleased()) { M5.Lcd.println("Button is released."); }else{ M5.Lcd.println("Button is Pressed ."); } delay(20); }
Syntaxe:
uint8_t pressedFor(uint32_t ms);
Description:
Paramètres:
Retour:
#include <M5Stack.h> void setup() { M5.begin(); } void loop() { M5.update(); M5.Lcd.setCursor(0, 0); if (M5.BtnA.releasedFor(2000)) { M5.Lcd.println("Button A was released for more than 2 seconds."); delay(1000); }else{ M5.Lcd.println("Button A is pressed "); } }
Syntaxe:
uint8_t wasReleased();
Description:
Paramètres:
Retour:
#include <M5Stack.h> void setup() { M5.begin(); M5.Lcd.println("Please pressed Button A."); } void loop() { M5.update(); if(M5.BtnA.wasReleased()) { M5.Lcd.println("Button is Released."); } delay(20); }
Syntaxe:
uint8_t wasReleasefor(uint32_t ms);
Description:
Paramètres:
Retour:
#include <M5Stack.h> void setup() { M5.begin(); M5.Lcd.println("Please pressed Button A."); } void loop() { M5.update(); if (M5.BtnA.wasReleasefor(3000)) { M5.Lcd.println("OK"); } }