satbir panesar / Mbed 2 deprecated elec350

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Button.cpp Source File

Button.cpp

00001 #include "Button.h"
00002 
00003 bool Button::isPressed()
00004 {
00005 // get current value of input pin
00006 int pinValue = this->pin->read();
00007 // check the value returned from the pin
00008 if (pinValue == 1){
00009     return true;
00010     }else{
00011         return false;
00012         }
00013     }