📅  最后修改于: 2022-03-11 14:44:47.634000             🧑  作者: Mango
int button = 2;
int flag;
int readbutton;
void setup(){}
void loop(){
readbutton = digitalRead(button);
if(readbutton>flag){
//your code here
flag=readbutton;
}
if(readbutton==0){
flag=0;
}