pdf-icon

System

begin

Functionality:

Clears the serial buffer, sets the serial baud rate to 115200; initializes I2C; initializes the LED matrix.

Function Prototype:

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

Usage Example:

#include "M5Atom.h"
void setup(){
    M5.begin(true, true, true); // Clears the serial buffer, sets the serial baud rate to 115200; initializes I2C; initializes the LED matrix.
}

update

Functionality:

Reads the state of the button.

Function Prototype:

void update()

Usage Example:

#include "M5Atom.h"
#include <M5Atom.h>

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

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