Program for the water play project for the course Software Testing Practical 2016 given at the VU University

Dependencies:   mbed DRV88255 TextLCD Ping mbed-rtos

ProximityController.cpp

Committer:
joran
Date:
2016-06-13
Revision:
15:487e56550364
Parent:
5:44ce56378b65

File content as of revision 15:487e56550364:

#include "ProximityController.h"

Ping pinger(p30);


ProximityController::ProximityController()
{
    printf ("Initialize proximity sensor\r\n");
}

int ProximityController::readDistance()
{
    int range;
     
    pinger.Send();    
    wait_ms(30);
    range = pinger.Read_cm()/ 2;   
    return range;
}