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.
Dependencies: LidarLitePwm mbed
main.cpp
- Committer:
- joe4465
- Date:
- 2015-03-18
- Revision:
- 0:cea49dbec4b6
- Child:
- 1:98f5bd664f94
File content as of revision 0:cea49dbec4b6:
#include "mbed.h"
#include "LidarLitePwm.h"
Serial _pc(USBTX, USBRX);
Timer _lidarTimer;
LidarLitePwm _lidar(p12, _lidarTimer);
int main()
{
_pc.baud(115200);
_lidarTimer.start();
printf("Started\r\n");
while(1)
{
int lidarAltitude = _lidar.read();
printf("altitude: %d cm\r\n", lidarAltitude);
wait_ms(20);
}
}