Basic HelloWorld on how to use LidarLitev2
Dependencies: LidarLitev2 mbed
Revision 1:b6f905ba0c2a, committed 2015-10-22
- Comitter:
- sventura3
- Date:
- Thu Oct 22 21:39:34 2015 +0000
- Parent:
- 0:1c42ae9ef9a2
- Commit message:
- Changed the main file to main -_-
Changed in this revision
Distance.cpp | Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 1c42ae9ef9a2 -r b6f905ba0c2a Distance.cpp --- 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
diff -r 1c42ae9ef9a2 -r b6f905ba0c2a main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 22 21:39:34 2015 +0000 @@ -0,0 +1,19 @@ +#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