一个按钮按住,按另一个按钮 灯不会亮起来求指导。#define LED1 4#define LED2 5#define KEY1 2#define KEY2 3char Flag_A1=0;int KEY_NUM1 = 0;int KEY_NUM2 = 0; void setup(){ pinMode(LED1, OUTPUT); pinMode(LED2, OUTPUT); pinMode(KEY1, INPUT_PULLUP); pinMode(KEY2, INPUT_PULLUP); }void loop(){ ScanKey(); if (KEY_NUM1 == 1 &&Flag_A1==0) { digitalWrite(LED1, !digitalRead(LED1)); Flag_A1=1; }elseFlag_A1=0; if (KEY_NUM2 == 1 &&Flag_A1==0) { digitalWrite(LED2, !digitalRead(LED2)); Flag_A1=1; } elseFlag_A1=0;}void ScanKey() { KEY_NUM1 = 0; KEY_NUM2 = 0; if (digitalRead(KEY1) == LOW) { delay(50); if (digitalRead(KEY1) == LOW) { KEY_NUM2 = 1; while (digitalRead(KEY1) == LOW); } } if (digitalRead(KEY2) == LOW) { delay(50); if (digitalRead(KEY2) == LOW) { KEY_NUM1 = 1; while (digitalRead(KEY2) == LOW); } }}