Test program for the LidarLitePwm library

Dependencies:   LidarLitePwm mbed

Files at this revision

API Documentation at this revision

Comitter:
joe4465
Date:
Wed Mar 18 08:57:07 2015 +0000
Child:
1:98f5bd664f94
Commit message:
V1.0 Works

Changed in this revision

LidarLitePwm.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LidarLitePwm.lib	Wed Mar 18 08:57:07 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/joe4465/code/LidarLitePwm/#32f0a592b9e5
--- /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);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Mar 18 08:57:07 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e188a91d3eaa
\ No newline at end of file