diff --git a/digital-clock.ino b/digital-clock.ino index 3c3787f..f40cec7 100644 --- a/digital-clock.ino +++ b/digital-clock.ino @@ -80,7 +80,8 @@ void loop(){ //如果reset键被按下,重置时钟 if(reset.isPressed() == true) { clock.reset(); - swi.changeStatus(); + swi.changeStatus(15); + reset.changeStatus(1); } //如果开关打开,则开始或停止计时 diff --git a/switch.h b/switch.h index ad73a27..388ac0d 100644 --- a/switch.h +++ b/switch.h @@ -43,7 +43,11 @@ public: return _status; } - bool changeStatus(){ + void changeStatus(int state){ + if(state == 15){ + this->_status = true; + return; + } this->_status = !(this->_status); }