RPLIDAR A1 conectet with arduino

emielvanstuijvenberg:
i am using a maga not a uno

What is a maga? There is a Mega...

You STILL haven't told us what the code ACTUALLY does. "It doesn't work" is adequate ONLY if you send each of us the exact same hardware you have, connected exactly the same way.