Loading... <!--more--> //定义全局变量 int flag = 0; boolean _up = false; //下面的程序放在loop()里 if(digitalRead(digitalPin) == LOW) flag = 1; if((digitalRead(digitalPin) == HIGH) && (flag == 1)) { _up = true; flag = 0; } if(_up) { _up = false; //这里写希望检测到上升沿后执行的程序 } Last modification:October 18, 2018 © Allow specification reprint Like 0 If you think my article is useful to you, please feel free to appreciate