#include <M5StickC.h>
void setup() {
M5.begin();
M5.Lcd.begin();
M5.Lcd.setRotation(3);
}
void loop() {
M5.Lcd.fillScreen(BLACK);
M5.Lcd.setCursor(0, 0, 1);
M5.Lcd.printf("AXP Temp: %.1fC \r\n", M5.Axp.GetTempInAXP192());
M5.Lcd.printf("Bat:\r\n V: %.3fv I: %.3fma\r\n", M5.Axp.GetBatVoltage(), M5.Axp.GetBatCurrent());
M5.Lcd.printf("USB:\r\n V: %.3fv I: %.3fma\r\n", M5.Axp.GetVBusVoltage(), M5.Axp.GetVBusCurrent());
M5.Lcd.printf("5V-In:\r\n V: %.3fv I: %.3fma\r\n", M5.Axp.GetVinVoltage(), M5.Axp.GetVinCurrent());
M5.Lcd.printf("Bat power %.3fmw", M5.Axp.GetBatPower());
M5.update();
delay(100);
}
Syntax:
void begin(void);
Description:
Parameters:
Return:
Example:
#include <M5StickC.h>
void setup() {
M5.begin();
}
void loop() {}
Syntax:
void PowerOff();
Description:
Parameters:
Return:
Example:
#include <M5StickC.h>
void setup() {
M5.begin();
M5.lcd.fillScreen(GREEN);
delay(3000);
M5.Axp.PowerOff();
}
void loop() {
}
Syntax:
void ScreenBreath(uint8_t brightness);
Description:
Parameters:
Return:
Example:
#include <M5StickC.h>
uint8_t i = 0;
void setup() {
M5.begin(); // By default, "M5.begin()" will initialize AXP192 chip
M5.Lcd.printf("Hello, M5Stack!!");
}
void loop() {
M5.Axp.ScreenBreath(i++);
if (i > 100) i = 0;
delay(10);
}
Syntax:
void ScreenSwitch(bool state);
Description:
Parameters:
Return:
Example:
#include <M5StickC.h>
uint8_t i = 0;
void setup() {
M5.begin();
M5.Lcd.fillScreen(BLUE);
}
void loop() {
M5.Axp.ScreenSwitch(true);
delay(1000);
M5.Axp.ScreenSwitch(false);
delay(1000);
}
Syntax:
bool GetBatState();
Description:
Parameters:
Return:
Syntax:
float GetBatVoltage();
Description:
Parameters:
Return:
Syntax:
float GetBatCurrent();
Description:
Parameters:
Return:
Syntax:
float GetVinVoltage();
Description:
Parameters:
Return:
Syntax:
float GetVinCurrent();
Description:
Parameters:
Return:
Syntax:
float GetVBusVoltage();
Description:
Parameters:
Return:
Syntax:
float GetVBusCurrent();
Description:
Parameters:
Return:
Syntax:
float GetTempInAXP192();
Description:
Parameters:
Return:
Syntax:
float GetBatPower();
Description:
Parameters:
Return: