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.
Diff: main.cpp
- Revision:
- 4:272090bf74fe
- Parent:
- 3:0a718d139ed1
- Child:
- 5:22ad3005bc11
--- a/main.cpp Wed Apr 24 16:00:07 2019 +0000
+++ b/main.cpp Wed Apr 28 11:19:28 2021 +0000
@@ -20,8 +20,10 @@
// Lidar initialization
rplidar_motor.period(0.001f);
+ rplidar_motor.write(0.85f);
lidar.begin(se_lidar);
lidar.setAngle(0,360);
+ setSpeeds(0,0);
pc.printf("Program started.\n");
@@ -29,6 +31,7 @@
while(1) {
// poll for measurements. Returns -1 if no new measurements are available. returns 0 if found one.
+ pc.printf("%f\n",rplidar_motor.read());
if(lidar.pollSensorData(&data) == 0)
{
pc.printf("%f\t%f\t%d\t%c\n", data.distance, data.angle, data.quality, data.startBit); // Prints one lidar measurement.