coucou
Dependencies: HC_SR04_Ultrasonic_Library mbed
main.cpp
- Committer:
- DELSAB
- Date:
- 2016-09-28
- Revision:
- 1:3bad1115bf14
- Parent:
- 0:5fba740a37eb
File content as of revision 1:3bad1115bf14:
#include "mbed.h" #include "ultrasonic.h" PinName trig = PA_10; PinName echo = PA_9; float updateSpeed = 1; // 1 Hz, 1 fois par sec float timeout = 2; int mesure = 0; int main() { ultrasonic(trig, echo, updateSpeed, timeout); while(1) { mesure = getCurrentDistance(); wait(0.1); printf("%d\n",mesure); wait(0.2); } }