i use InterruptIn on button.but when i click button one time the flip() always do servals times.I don't konw how to control it. I only want to do only once when i click button once.
Hmm, probably the bounce of the button. create a routine, that after 25 mS asks if the state of the button is correct, then start the timer. Thats the best software debounce I've created so far.
This site uses cookies to store information on your computer.
By continuing to use our site, you consent to our cookies.
If you are not happy with the use of these cookies, please review our
Cookie Policy
to learn how they can be disabled.
By disabling cookies, some features of the site will not work.
Access Warning
You do not have the correct permissions to perform this operation.
hello everyone:
void flip() {
pc.printf("0 ");
}
int main() {
button.rise(&flip);
while(1) {
flash = !flash;
wait(0.25);
}
}
i use InterruptIn on button.but when i click button one time the flip() always do servals times.I don't konw how to control it. I only want to do only once when i click button once.