Grove soundsensor lib
Diff: soundsensor.cpp
- Revision:
- 1:29daa2bdd0c6
- Parent:
- 0:18d442efc99a
- Child:
- 3:372e67c123c3
--- a/soundsensor.cpp Thu Jan 17 07:42:19 2019 +0000 +++ b/soundsensor.cpp Thu Jan 17 08:10:53 2019 +0000 @@ -1,7 +1,7 @@ #include "soundsensor.h" soundsensor::soundsensor(PinName pin){ - play_buzzer::setPin(pin); + soundsensor::setPin(pin); } void soundsensor::setPin(PinName pin){ @@ -20,10 +20,11 @@ /** *CODE NEEDS TO BE IMPLEMENTED **/ + return 0; } float soundsensor::listen(bool toDb){ - AnalogIn(this->getPin()) sensor; + AnalogIn sensor(this->getPin()); float value = sensor.read_u16(); if(toDb){ return this->convertToDb(value);