K64F

Dependencies:   mbed

Fork of HCSR04 by Prabhu Desai

main.cpp

Committer:
andcor02
Date:
2017-01-13
Revision:
8:25138f7b9309

File content as of revision 8:25138f7b9309:

#include "mbed.h"
#include "hcsr04.h"

 
DigitalOut myled(LED1);
HCSR04  usensor(D8,D9);
unsigned int dist;
int main()
{
 
    while(1) {
        usensor.start();
        wait_ms(500); 
        dist=usensor.get_dist_cm();
        printf("\n\r cm:%ld",dist );
 
    }
}