Skip to content

Commit 1c93706

Browse files
committed
add axp2101 support
1 parent 8340b67 commit 1c93706

File tree

12 files changed

+2592
-571
lines changed

12 files changed

+2592
-571
lines changed

examples/Basics/vibrate/vibrate.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
22
*******************************************************************************
3-
* Copyright (c) 2021 by M5Stack
3+
* Copyright (c) 2023 by M5Stack
44
* Equipped with M5Core2 sample source code
55
* 配套 M5Core2 示例源代码
66
* Visit for more information: https://docs.m5stack.com/en/core/core2
77
* 获取更多资料请访问: https://docs.m5stack.com/zh_CN/core/core2
88
*
99
* Describe: vibrate example. 震动电机示例
10-
* Date: 2021/9/18
10+
* Date: 2023/11/17
1111
*******************************************************************************
1212
*/
1313
#include <M5Core2.h>
@@ -25,8 +25,8 @@ The loop() function is an infinite loop in which the program runs repeatedly
2525
在setup()函数中的程序执行完后,会接着执行loop()函数中的程序
2626
loop()函数是一个死循环,其中的程序会不断的重复运行 */
2727
void loop() {
28-
M5.Axp.SetLDOEnable(3, true); // Open the vibration. 开启震动马达
28+
M5.Axp.SetVibration(true); // Open the vibration. 开启震动马达
2929
delay(1000);
30-
M5.Axp.SetLDOEnable(3, false); // Open the vibration. 关闭震动马达
30+
M5.Axp.SetVibration(false); // Open the vibration. 关闭震动马达
3131
delay(1000);
3232
}

examples/FactoryTest/FactoryTest/FactoryTest.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,7 +1654,7 @@ void AppSetting() {
16541654
}
16551655

16561656
if (MoterBtn.inHotZone(pos)) {
1657-
M5.Axp.SetLDOEnable(3, MoterState);
1657+
M5.Axp.SetVibration(MoterState);
16581658
if (MoterState == 1) {
16591659
Disbuff.fillRect(193, 103, 14, 47, TFT_GREEN);
16601660
} else {
@@ -1935,10 +1935,10 @@ void setup() {
19351935
InitI2SSpakerOrMic(MODE_SPK);
19361936
xTaskCreatePinnedToCore(i2s_task, "i2s_task", 4096, NULL, 3, NULL, 0);
19371937

1938-
M5.Axp.SetLDOEnable(3, true);
1938+
M5.Axp.SetVibration(true);
19391939
CoverScrollText("Motor Test", M5.Lcd.color565(SUCCE_COLOR));
19401940
delay(150);
1941-
M5.Axp.SetLDOEnable(3, false);
1941+
M5.Axp.SetVibration(false);
19421942

19431943
M5.Axp.SetLed(1);
19441944
CoverScrollText("LED Test", M5.Lcd.color565(SUCCE_COLOR));

0 commit comments

Comments
 (0)