ok

Dependencies:   mbed SRF05

main.cpp

Committer:
stersky
Date:
2019-02-12
Revision:
1:fe48c0878de2
Parent:
0:d87132986e8f

File content as of revision 1:fe48c0878de2:

// Simple program to read the distance from an SRF05 using the SRF05 library

#include "mbed.h"
#include "SRF05.h"

//Initialisation des lectures des capteurs à ultrasons
SRF05 srf1(p6, p5);

//Initialisation des lectures de la télécommande

Serial PC(USBTX, USBRX);
 
int main() { 

    PC.baud(460800);
    
     while(1) { 
         PC.printf("Distance1 = %1fcm\n\r", srf1.read());              
         wait(0.2); 
     } 
 }