I downloaded the library from github GitHub - robopeak/rplidar_arduino: RoboPeak RPLIDAR driver for Arduino and Arduino-compatible devices and it seems the code doesn’t work, I tried many things. I read from some posts that I need to change serial to (lidar.begin(Serial3); ) (i am using mega 2560) still no use and instead show this error (stk500v2_ReceiveMessage(): timeout ). As well only this library works #include <RPLidar.h> while other libraries like (#include <rplidar_driver_impl.h> #include <rplidar_driver_serial.h>) don’t work. I don’t have much experience in programming only the basics of C++. when I uploaded the program (leaving lidar.begin(Serial); unchanged and removing other libraries because other libraries besides #include <RPLidar.h> is not recognised and the program won’t upload)and go to serial monitor to see the results which I expected it to be showing distance and angles, it showed something like this (//?//). Sometimes it won’t work and show this error (avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
An error occurred while uploading the sketch).
I am stuck any help or advice will be thankful, I have been trying for days now.
simple_connect.ino (2.68 KB)