Thursday, March 19, 2015

16x16 LED with Arduino

I think I've mentioned before I have a bit of an eBay habit.  Searching for random electronics parts that can work with Arduino or Raspberry Pi.

On one of these eBay trawls I cam across the following 16x16 LED display.  It's really 4 8x8 LED displays on a single board with what look like electronics to make it easy to control.
Looking at it I kind of thought this should be easy to get working so put down my 

When I finally got around to plugging it in I did the obvious and searched online to see if someone with more electronics and computing ability had played with the 16x16 already and worked it out.
To my pleasure and delight I came across the following page with schematic, datasheets and Arduino sample code.

I wired up the display as directed and uploaded the sketches provided and it worked first time.
The demo code had comments not in English and even then there were very few comments so I kind of figured out that the data for the pixels was held in an array of 32 Bytes. (32 x 8 = 16 x 16, so a Bit for each dot)

The one thing I couldn't figure out from the data was what order the data had to entered into the array in and thought to move this forward I'd figure out the order of the data.
First thing I found was that a 0 in the bit turned the pixel on, so the image is reversed.
Then by putting B11111111 in each position one after another I figured out the order.


Best way to think of it is 
Row 1 / Columns 1-8
Row 2 / Columns 1-8
Row 3 / Columns 1-8
Row 4 / Columns 1-8
Row 5 / Columns 1-8
Row 6 / Columns 1-8
Row 7 / Columns 1-8
Row 8 / Columns 1-8
Row 9 / Columns 1-8
Row 10 / Columns 1-8
Row 11 / Columns 1-8
Row 12 / Columns 1-8
Row 13 / Columns 1-8
Row 14 / Columns 1-8
Row 15 / Columns 1-8
Row 16 / Columns 1-8
Row 1 / Columns 9-16
Row 2 / Columns 9-16
Row 3 / Columns 9-16
Row 4 / Columns 9-16
Row 5 / Columns 9-16
Row 6 / Columns 9-16
Row 7 / Columns 9-16
Row 8 / Columns 9-16
Row 9 / Columns 9-16
Row 10 / Columns 9-16
Row 11 / Columns 9-16
Row 12 / Columns 9-16
Row 13 / Columns 9-16
Row 14 / Columns 9-16
Row 15 / Columns 9-16
Row 16 / Columns 9-16

And just to show I managed to get something displayed here is one I made earlier.

More playing to be done now I can get an image on the display.

Robot Club (I can't remember which one this is)

It's coming to an end.
We did the penultimate robot club session this week.
Seven from ten made it this week. I believe one decided it wasn't for them while two others had other things on.

This week we got the 4 teams robots all working and also turning when they came near to the walls. A couple of teams really got it and were adapting their code to make their robots do interesting things when it was near the wall.  While the other 2 needed to back over the concept of variables and conditional statements.

For the teams that were racing ahead they spend time working on putting a body on their robots.  I spoke to the ICT Co-ordinator and they were going to arrange for the kids to have assembly time to do the body and make their robots unique.  Looking forward to seeing what the the robots look like on Monday.