System function

begin()

Function:

Clear the serial port buffer and set the serial port baud rate to 115200. Initialize I2C. Initialize the LED matrix

Syntax:

void begin(bool SerialEnable, bool I2CEnable, bool DisplayEnable);

Example:

#include "M5Atom.h"
void setup(){
    M5.begin(true, true, true); // Clear the serial port buffer and set the serial port baud rate to 115200. Initialize I2C. Initialize the LED matrix
}

update()

Function:

Read the state of the key

Syntax:

void update()

Example:

#include <M5Atom.h>

void setup() {
  M5.begin();
}

void loop() {
  M5.update();    //You need to add m5.update () to read the state of the key, see System for details
  if (M5.Btn.isPressed()) {    //If the button is pressed
    Serial.println("Button is pressed.");
  }
  delay(20);
}
On This Page