Arduino Guide
Description:
Clears the serial buffer, sets the serial baud rate to 115200; initializes I2C; initializes the LED matrix.
Syntax:
void begin(bool SerialEnable, bool I2CEnable, bool DisplayEnable)
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.
}
Description:
Reads the state of the button.
Syntax:
void update()
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);
}