From 896c599202249733c1926f9d9a09cf77cd31b903 Mon Sep 17 00:00:00 2001 From: Tinyu Date: Mon, 9 Aug 2021 18:44:15 +0800 Subject: [PATCH] button --- examples/Unit/DUAL_BUTTON/DUAL_BUTTON.ino | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/Unit/DUAL_BUTTON/DUAL_BUTTON.ino b/examples/Unit/DUAL_BUTTON/DUAL_BUTTON.ino index 2085f99..94d8524 100644 --- a/examples/Unit/DUAL_BUTTON/DUAL_BUTTON.ino +++ b/examples/Unit/DUAL_BUTTON/DUAL_BUTTON.ino @@ -21,8 +21,8 @@ int cur_value1 = 0,cur_value2 = 0; void setup() { M5.begin(); //Init M5Stack. 初始化M5Stack M5.Power.begin(); //Init power 初始化电源模块 - pinMode(21, INPUT); //set pin mode to input.设置引脚模式为输入模式 - pinMode(22, INPUT); + pinMode(36, INPUT); //set pin mode to input.设置引脚模式为输入模式 + pinMode(26, INPUT); M5.Lcd.setTextColor(YELLOW); //Set the font color to yellow. 设置字体颜色为黄色 M5.Lcd.setTextSize(2); //Setting the Font size. 设置字号大小 M5.Lcd.setCursor(80, 0); //Set the cursor position to (80,0). 将光标位置设置为(80,0) @@ -31,8 +31,8 @@ void setup() { } void loop() { - cur_value1 = digitalRead(22); // read the value of BUTTON. 读取22号引脚的值 - cur_value2 = digitalRead(21); + cur_value1 = digitalRead(36); // read the value of BUTTON. 读取22号引脚的值 + cur_value2 = digitalRead(26); M5.Lcd.setCursor(90,25); M5.Lcd.print("Btn.1 Btn.2"); M5.Lcd.setCursor(0,45); M5.Lcd.print("Value: "); M5.Lcd.setCursor(0,85); M5.Lcd.print("State: ");