Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: button.cpp
- Revision:
- 13:4b9c32ba0572
- Parent:
- 12:08a1971c9441
- Child:
- 14:6427883f5900
--- a/button.cpp Thu Nov 12 12:01:14 2015 +0000 +++ b/button.cpp Thu Nov 12 12:07:39 2015 +0000 @@ -13,9 +13,6 @@ float Button::getPulse(float timeout) { - while(this->ifPressed()== false){ - //DO NADA - } Timer timer; timer.start(); @@ -26,6 +23,10 @@ } } + while(this->ifPressed() == true){ + wait(0.01f); + } + timer.stop(); return timer.read(); } \ No newline at end of file