Ultraschall funktioniert

Dependencies:   SRF08 mbed

main.cpp

Committer:
rgiesecke
Date:
2017-01-17
Revision:
0:aef042479c18

File content as of revision 0:aef042479c18:

#include "mbed.h"
#include "SRF08.h"

SRF08 Uschall(p9,p10,0xE4);
int Entfernung = 0;


int main() {
    while(1) {
        Uschall.startRanging();
        while (Uschall.rangingFinished() == 0) {
            }
        Entfernung = Uschall.getRange();
        printf("Entfernung: %d\n\r ", Entfernung);
    }  
}