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
Diff: main.cpp
- Revision:
- 0:cea49dbec4b6
- Child:
- 1:98f5bd664f94
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Mar 18 08:57:07 2015 +0000
@@ -0,0 +1,23 @@
+#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);
+ }
+}