Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
source.cpp
- Committer:
- corentinlenel
- Date:
- 2018-12-23
- Revision:
- 0:01d408baf267
File content as of revision 0:01d408baf267:
#include "header.h"
AnalogIn sonar(p16);
BusOut leds(LED1, LED2, LED3, LED4);
void test(void)
{
float mesure1, mesure2;
mesure1 = sonar.read();
wait(0.5);
mesure2 = sonar.read();
if (abs(mesure1 - mesure2) < 0.1f)
{
leds = 15;
}
else
{
leds = 0;
}
}