Basic HelloWorld on how to use LidarLitev2
Dependencies: LidarLitev2 mbed
Diff: Distance.cpp
- Revision:
- 1:b6f905ba0c2a
- Parent:
- 0:1c42ae9ef9a2
--- a/Distance.cpp Thu Oct 22 21:36:14 2015 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -#include "LidarLitev2.h" - - -LidarLitev2 Lidar(p28, p27); -Serial pc(USBTX,USBRX); - - -Timer dt; -int main() -{ - - pc.baud(115200); - Lidar.configure(); - dt.start(); - while(1){ - pc.printf("distance = %d cm frequency = %.2f Hz\n", Lidar.distance(), 1/dt.read()); - dt.reset(); - } -} \ No newline at end of file