Scrolling designs with the Arduino Uno and Lol shield (LED shield)

For this little project, the parts used were an Arduino Uno, the Lol Shield, a power cord for the Arduino, and a USB cable to connect it to my computer to program the board.



To start off, I had to first download the Arduino IDE so that I could program the Arduino board.  Then I downloaded the library needed to use the shield with the board from this GitHub link and then extracted the file into the libraries section of the Arduino program files.  Then I plugged in the board and selected an example from the library
then I uploaded it onto the board and checked the LED's.
After checking, most of the LED's worked, but some didn't, and remained so despite re-soldering them.

After looking at the code in the example and analyzing it based on what it shows, I found that it was essentially a sequence of sets, where each of the 9 elements in each set depicts a row, and the number for each row displays in a binary fashion across each row (i.e. 1 means the first LED is on, 3 means the first 2, etc.).

Next I set out to make a scrolling design of my own, and figured a smiley face would be cool to try.  I used some example code for an already scrolling design, then modified the sets of values that dictated what the scrolling design was.  Then on a whiteboard I mapped out all the LED's and corresponding values, and the positions which would have to be turned on when the face was roughly in the center.
Then I began the process of going through each state of the LED matrix as it scrolled through, added up the values, and input each of them into a set, and repeated for the entire animation.

Something that made the tedious math of it a bit easier was recognizing that until the face started scrolling off the screen, it was just a shift-right and add operation (i.e. just doubling whatever number, and adding 1 if there was an additional LED).  Additionally, once the face started scrolling off of the screen, then it was still a shift-right operation, but if there is an LED dropping off, then you subtract 8192*2 from the value.

Below is the finished product, a simple smiley face scrolling across the screen.


via GIPHY

For whatever reason, there are extraneous LED's that light up even though they aren't supposed to do so, and nothing in the code dictates that they should.  This is likely caused by some connection problems, since the shield was very finicky when trying to put it on the Arduino and have all LED's light up.

All of the code that makes this run on the board (besides the libraries for the shield) can be found in this pastebin.

While there wasn't much of a point to this project in terms of learning, it was fun to do and it produced a cool looking result.

Comments