I finally got around to working with the RPLidar and NeoPixel Ring controlled with an Arduino. I just want share what I’ve done so far. The angle information is applied to a coresponding pixel and the color is determined by the distance information. I’ve attached the sketch for the Arduino and a PDF with directions and parts list.
_RPLIDAR_and_NeoPixel_Ring_24.ino _RPLIDAR_and_NeoPixel_Ring_24.pdf_RPLIDAR_and_NeoPixel_Ring_24.pdf (131 KB)
That would make for a nice video demo!
The NeoPixels screw up the video.
I updated the Arduino sketch.
RPLidar_NeoPixel_0.ino is sketch for Arduino reading RPLIDAR data and turning on a Adafruit NeoPixel 24 ring. Works great. RPLIDAR_XBEE_XBEE_NEOPIXEL_1.ino is sketch for Arduino reading RPLIDAR data and sending by SparkFun XBee shield. Data out looks good in XCTU from Sparkfun USB XBee dongle. RPLIDAR_XBEE_XBEE_NEOPIXEL_2.ino is sketch for another Arduino receiving from SparkFun XBee shield and then turning on a Adafruit NeoPixel 24 ring with the data. The code needs some help. It doesn’t work as nice as the direct method. First time working with XBees.
Hi,
This is a very interesting use of those two components. It would really be great to have a video of it in action if you could give it another try.
You can increase your chances of receiving help from the RobotShop community by detailing what you mean by “it doesn’t work as nice as the direct method”. If your issue is related to delays in transmitting the data between the XBees, you could consider changing the baud rate of the two modules from the default of 9600 (using the configuration software). If you do, make sure to change the baud rate values in the sketches on both Arduinos.
Sincerely,
What I mean by not as nice, is either the data gets garbled or there’s to much delay in breaking down the data. I was wondering if using API mode would eliminate errors. The direct method there’s no lag or delay in update of data. I think if you look at my code for the display end of the process, it might explain what’s going on. I need to read up on using API. I have feeling that’s what needs to be used. Thank you for response. I’ll get the videos done sometime. I have to work out the lighting.
Please keep the RobotShop community updated with this interesting project. We are looking forward to your video.
As for the issue with the data, if it is taking too long to process it, you may need to change the way you encode the data, the way you process it or run the microcontroller at a faster speed (and maybe all of those). It is also common for processing high speed data to use hand-tuned assembly code to make the process more efficient. We recommend that you debug your software further to determine what the bottlenecks are. AVR Studio has plenty of nice debugging features, if you don’t mind converting your project to C instead of Arduino sketches.
Sincerely,