初始化提交

This commit is contained in:
王立帮
2024-07-20 22:09:06 +08:00
commit c247dd07a6
6876 changed files with 2743096 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
/*
*******************************************************************************
* Copyright (c) 2021 by M5Stack
* Equipped with M5Core2 sample source code
* 配套 M5Core2 示例源代码
* Visit the website for more information: https://docs.m5stack.com/en/core/core2
* 获取更多资料请访问: https://docs.m5stack.com/zh_CN/core/core2
*
* describe: vibrate example. 震动电机示例
* date: 2021/9/18
*******************************************************************************
*/
#include <M5Core2.h>
/* After M5Core2 is started or reset
the program in the setUp () function will be run, and this part will only be run once.
在 M5Core2 启动或者复位后即会开始执行setup()函数中的程序,该部分只会执行一次。 */
void setup() {
M5.begin(); //Init M5Core2. 初始化 M5Core2
}
/* After the program in setup() runs, it runs the program in loop()
The loop() function is an infinite loop in which the program runs repeatedly
在setup()函数中的程序执行完后会接着执行loop()函数中的程序
loop()函数是一个死循环,其中的程序会不断的重复运行 */
void loop() {
M5.Axp.SetLDOEnable(3,true); //Open the vibration. 开启震动马达
delay(1000);
M5.Axp.SetLDOEnable(3,false); //Open the vibration. 关闭震动马达
delay(1000);
}