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.
Dependencies: mbed DRV88255 TextLCD Ping mbed-rtos
Diff: ProximityController.cpp
- Revision:
- 25:169672dbab91
- Parent:
- 10:fd4670ec0806
- Child:
- 27:4f73f754fdc9
--- a/ProximityController.cpp Mon Jun 13 13:47:33 2016 +0000 +++ b/ProximityController.cpp Mon Jun 13 13:49:40 2016 +0000 @@ -3,6 +3,7 @@ Ping pinger(p30); +float distance_to_base = 14.5; void ProximityController::update() { int range; @@ -13,9 +14,14 @@ this->distance = (float)range; } +float ProximityController::getDistance() +{ + return this->distance; +} float ProximityController::getValue() { - return this->distance; + this->volume = (this->ditance - distance_to_base) * ((100/12) *10); + return this->volume; } std::string ProximityController::get_name() {