Control 8x8 grid of RGB LEDs like Raspberry Pi Sense Hat or Unicorn Hat?

asked 2015-12-24 00:30:48 -0500

dchang0 gravatar image

updated 2015-12-24 00:53:18 -0500


I'm completely new to ROS.

We have a project where battery power is limited but we need some real-time visualization of sensor inputs. We're looking for ways to avoid using rviz on a tiny TFT screen due to the current draw.

One way that may save us power and give us a few more sensors is to use the Raspberry Pi's Sense Hat, which has an 8x8 grid of RGB LEDs that can be dimmed to very low brightness. It would work perfectly for our project.

I did a little searching and didn't find any mention of LED grids or arrays. I did find a tutorial on controlling a single RGB LED here:

The Sense Hat and Pimoroni's Unicorn Hat are both easily controlled via very simple Python APIs; the Sense Hat is documented here at . It's pretty much one-line member function calls to draw the entire grid.

My questions are:

1) Is there already some code out there for outputting to an RGB LED grid? If so, could you point me to it?

2) If not, how hard would it be to write the ROS code myself? I am an experienced bash, Perl, and PHP coder but new to Python and ROS. The amount of code necessary to control the one RGB LED in the tutorial seems a bit high. If we're talking over 8 hours of reading documentation and then coding even with the Sense Hat's simple Python API, then it is probably not worth it to try this idea. Keep in mind that the coding part is probably not the bulk of the time needed--I really don't know anything about ROS and so would have to read tons of docs before being able to write good code.

Thanks in advance for any help you may provide!

edit retag flag offensive close merge delete