feat: 全量同步 254 个常用的 Arduino 扩展库文件

This commit is contained in:
yczpf2019
2026-01-24 16:05:38 +08:00
parent c665ba662b
commit 397b9a23a3
6878 changed files with 2732224 additions and 1 deletions

View File

@@ -0,0 +1,49 @@
// Copyright (c) M5Stack. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "M5StickCPlus.h"
M5StickCPlus::M5StickCPlus():isInited(0) {
}
void M5StickCPlus::begin(bool LCDEnable, bool PowerEnable, bool SerialEnable){
//! Correct init once
if (isInited) return;
else isInited = true;
//! UART
if (SerialEnable) {
Serial.begin(115200);
Serial.flush();
delay(50);
Serial.print("M5StickCPlus initializing...");
}
// Power
if (PowerEnable) {
Axp.begin();
}
// LCD INIT
if (LCDEnable) {
Lcd.begin();
}
if (SerialEnable) {
Serial.println("OK");
}
Beep.begin();
Rtc.begin();
}
void M5StickCPlus::update() {
M5.BtnA.read();
M5.BtnB.read();
}
M5StickCPlus M5;