LED Matrix Painter with Joystick #3DPrinting #3DThursday

Universal Joystick – Drawing on the matrix from Chris Schmitz on Vimeo.

This is a bit of a tangent for the joystick project, but I hit an itch an needed to scratch it.

Once I wrote the code for moving a cursor LED around on the matrix I immediately wanted to use it to draw. In my normal higher level languages this wouldn’t have been an issue, but I didn’t realize that C++ doesn’t have a concept of array push/pop/slice natively which made the idea of tracking the “on” state for multiple LEDs in the grid a bit more difficult.

Yeah I could have brought in a library to add the push/pop/slice functionality, but this is a learning exercise for me so I wanted to figure it out without the additional library.

So, I though out a way of translating the x,y of the cursor into an integer and using that to refer to a specific index of an array to track the on/off state of all LEDs in the matrix.

I grappled with it a bit and in the end figured out a decent way of handling it (which I’m sure I could have looked up somewhere but again, I’m using this as a learning exercise).

See more!

Every Thursday is #3dthursday here at Adafruit! The DIY 3D printing community has passion and dedication for making solid objects from digital models. Recently, we have noticed electronics projects integrated with 3D printed enclosures, brackets, and sculptures, so each Thursday we celebrate and highlight these bold pioneers!

Have you considered building a 3D project around an Arduino or other microcontroller? How about printing a bracket to mount your Raspberry Pi to the back of your HD monitor? And don’t forget the countless LED projects that are possible when you are modeling your projects in 3D!

Join 4,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

Learn “How Computers Work” with Bill Gates, Ladyada and more – From Code.org !

CircuitPython in 2018 – Python on Microcontrollers is here!

Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Follow Adafruit on Instagram for top secret new products, behinds the scenes and more https://www.instagram.com/adafruit/

Maker Business — Prototyping PCBs with Particle, a guide from a pro in the field #makerbusiness

Wearables — From mat to hat

Electronics — Even lower power!

Biohacking — Nectome’s Brain Preservation and Backup Service Plan

Python for Microcontrollers — Scott ([email protected]) on the Amp Hour podcast!

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !

No Comments

No comments yet.

Sorry, the comment form is closed at this time.