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.
button.cpp
- Committer:
- Oschofield
- Date:
- 2015-11-10
- Revision:
- 9:a018d7c05dc7
- Parent:
- 8:ad8e2dd314a2
- Child:
- 10:8a6ecbf764fa
File content as of revision 9:a018d7c05dc7:
#include "button.h" //header file included Button::Button(string s){ if (s == "user"){ pin = new DigitalIn(PA_0); } } bool Button::ifPressed(){ return *pin; } float Button::getPulse() { while(this->ifPressed()== false){ //DO NADA } Timer timer; timer.start(); while(this->ifPressed()== true){ wait(0.01f); } timer.stop(); return timer.read(); }