my library for elec350

Dependencies:   mbed

Committer:
spanesar
Date:
Wed Oct 19 20:33:20 2016 +0000
Revision:
3:d62097c19a4e
added microphone files;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
spanesar 3:d62097c19a4e 1 #include "Button.h"
spanesar 3:d62097c19a4e 2
spanesar 3:d62097c19a4e 3 bool Button::isPressed()
spanesar 3:d62097c19a4e 4 {
spanesar 3:d62097c19a4e 5 // get current value of input pin
spanesar 3:d62097c19a4e 6 int pinValue = this->pin->read();
spanesar 3:d62097c19a4e 7 // check the value returned from the pin
spanesar 3:d62097c19a4e 8 if (pinValue == 1){
spanesar 3:d62097c19a4e 9 return true;
spanesar 3:d62097c19a4e 10 }else{
spanesar 3:d62097c19a4e 11 return false;
spanesar 3:d62097c19a4e 12 }
spanesar 3:d62097c19a4e 13 }