Pocket Full of LEDs

This is a look back at an old project from around the year 2008. I thought it might be nice to document some of these older experiments. Plus, it's been so long in this case that it's a bit fun to review something I hardly remember anything about.

A little backstory - my interest in hacking around with computers and code started around middle school, 7th or 8th grade. And ever since that first “Hello World” printed on the screen I dreamt of writing code that interacted with the physical world, beyond the display. Robots, machines, toys – none of the programming books I had access to mentioned any of this. The crowning project of my “Sams” C++ book was a business spreadsheet app.

I kept coding, playing, and making games for the next few years. But always I longed for a way to communicate beyond the screen.

Around this time, long before YouTube or streaming video, there were a handful of ‘web shows’ emerging online. Video podcasts testing the limits of the burgeoning high-speed internet age.

I was hooked on every minute of one such show called SYSTM from Kevin Rose, Patrick Norton and others about hacking, hardware, and nerd culture. It was like nothing I had seen before – a show for nerds like me. Every episode took hours to download but it didn’t matter.

Then, episode 12 – “AVR 101”. An introduction to the ATTiny2313, a $2 microcontroller. It was everything I knew I wanted – a way to bridge code into the physical.

SYSTM episode 0012, Revision3 via archive.org

I immediately made a parallel-port AVR programmer out of parts from RadioShack, got my hands on an ATTiny2313 (I think from eBay of all places), and started tinkering.

I don’t remember what inspired me to make an LED matrix display as one of my first AVR projects, or where the scanning demuxer design came from, but I do remember soldering these dang cross-over leads for each LED took hours and by the end I was filled with regret.

Back of the perfboard with ratsnest of wires

The circuit consists of an ATTiny2313 driving two 74 series decoders which together could enable one column of LEDs at a time. The AVR has one pin for each row so by scanning the columns across it was possible to drive the whole display with just these components.

One of the primary flaws of this project is that the AVR pins drive the LEDs directly and the current the pins have available is just barely enough to make all this work, especially if you’re trying to light an entire column at once.

Programming anything interesting for the display was another challenge. I made a web tool so I could visually paint letters. It output C code for a huge switch statement that represented the alphabet.

Web tool for drawing letters
(I can't believe I found this file)

I had the circuit and code working to show a static image but once I got the font all drawn and placed in code everything stopped working! Scrambled lights and serial output even if I only wanted to show the static image again. 🤔

Turns out only about half of my ‘font’ fit in the 2Kb of the ATTiny2313, ha! Having no idea how to optimize any of this, I settled on commenting out any letters I wasn’t using in a particular message.

I eventually bought an ATTiny4313 which *doubled* my program space to 4Kb – more than enough for A-Z plus several static images. (Maybe starting with 2Kb of program space is why I get so cranky about Electron and React 😜)

I just like this shot

The entire source code is follows (but I’ve made no attempt to clean 2008 Thomas’ mess 😄)

/* LED Matrix Controller */

/* Include useful pre-defined functions */
#include <avr/interrupt.h>    // Defines pins, ports, etc to make programs easier to read
#define F_CPU 1000000UL	      // Sets up the default speed for delay.h
#include <util/delay.h>

typedef int bool;
#define true 1
#define false 0

//Definitions
//PortB 0-7 => Rows 1-8
//PortD 5-6 => Rows 9-10
//PortD 0-3 => Column BCD
#define MAXROW 15
#define SCROLL_TIME 10

//Function prototypes
void setRows(int iRows);
void setColumn(int iColumn);
void display(int iTimePerCol, int iScans);

void setMessage(char* myMessage);
char getNextChar(int peek);

void setImage(int iImgNum);

void setChar(char cChar, int iPosition, int myBuffer[]);
void alphabet(int iASCII, int myImage[]);


void flip(int iColumnIndex);
void flipSwitch(int iFrontColumn, int iBackColumn);
void flipAll(void);
void clearBuffer(int myBuffer[]);

void shiftLeft(int myBuffer[]);

int iBackBuffer[MAXROW]  = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int iFrontBuffer[MAXROW] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

char* cMessage;
int iMsgPos;

//
// Note(thomas): If the display doesn't do anything after successful upload
//				 try changing the optimization level in the makefile (OPT)
//				 's' totally borked the code, '1' seems to work now.
//

int main(void)
{

	DDRB = 0b011111111;		/* enable output on port B, pin 0-7 */
	DDRD = 0b001111111;		/* enable output on port D, pin 0-6 */

	PORTD = 0b00000000;		//Reset Outputs
	PORTB = 0b00000000;

	//Apparent max length: 23 characters
	setMessage("TOEMAT LABS");

	int count=0;
	while(1)
	{
		iMsgPos = 0;
		clearBuffer(iFrontBuffer);

		while(getNextChar(1) != '\0')
		{
			setChar(getNextChar(0),0, iBackBuffer);
			setChar(getNextChar(0),1, iBackBuffer);

			for(int i=0;i<15;i++)
			{
				shiftLeft(iFrontBuffer);
				flipSwitch(14,0);
				shiftLeft(iBackBuffer);
				display(5,SCROLL_TIME);
			}

			shiftLeft(iFrontBuffer);
			display(5,SCROLL_TIME);
		}

		clearBuffer(iBackBuffer);

		//Scroll end off the screen.
		for(int i=0;i<14;i++)
		{
			shiftLeft(iFrontBuffer);
			flipSwitch(14,0);
			shiftLeft(iBackBuffer);
			display(5,SCROLL_TIME);
		}
		//Blanksies for a bit!
		display(5,100);

		setImage(10);
		flipAll();
		display(5,200);

		setImage(15);
		flipAll();
		display(5,15);

		setImage(10);
		flipAll();
		display(5,200);

		setImage(15);
		flipAll();
		display(5,15);

		setImage(11);
		flipAll();
		display(5,200);

		setImage(11);
		flipAll();
		display(5,20);

		setImage(12);
		flipAll();
		display(5,20);

		setImage(13);
		flipAll();
		display(5,20);

		setImage(14);
		flipAll();
		display(5,20);

		setImage(10);
		flipAll();
		display(5,200);
		/*

		if(count%6==0 && count>1){
			setImage(1);	//Turkey
			flipAll();
			display(5,700);
		} else if(count%2==0){
			setImage(6); 	//CAVAD
			flipAll();
			display(5,700);

			setImage(7);
			flipAll();
			display(5,50);
			setImage(8);
			flipAll();
			display(5,50);
			setImage(9);
			flipAll();
			display(5,50);
			setImage(6);
			flipAll();
			display(5,50);
		} else {
			setImage(2);	//cbuDesign
			flipAll();
			display(5,700);
		}
		*/
		count++;
	}

	return(0);
}

void setRows(int iRows )	//iRows: 10 bits
{
	//Get the 10 bits needed for the row enables,
	//and put them on the right pins.
	PORTB=iRows & 0b0011111111;

	PORTD=((iRows>>3) & 0b0001100000) | (PORTD & 0b10011111);

}

void setColumn(int iColumn)
{
	PORTD=(iColumn & 0b00001111) | (PORTD & 0b11110000);
}


void display(int iTimePerCol,int iScans)
{
	for(int k=0; k<iScans; k++)
	{
		for(int i=0;i<MAXROW;i++)
		{
			//Reset the Row Lines so they don't ghost
			setRows(0);
			setColumn(i);
			setRows(iFrontBuffer[i]);
			_delay_us(500);
		}
	}
}


void setMessage(char* myMessage)
{
	cMessage = myMessage;
	iMsgPos=0;
}

char getNextChar(bool peek)
{
	char next = cMessage[iMsgPos];

	if(next != '\0' && !peek){
		iMsgPos++;
	}

	return next;
}

void flip(int iColumnIndex)
{
	iFrontBuffer[iColumnIndex]=iBackBuffer[iColumnIndex];
}

void flipSwitch(int iFrontColumn, int iBackColumn)
{
	iFrontBuffer[iFrontColumn]=iBackBuffer[iBackColumn];
}

void flipAll(void)
{
	for(int i=0;i< MAXROW;i++)
	{
		iFrontBuffer[i]=iBackBuffer[i];
	}
	clearBuffer(iBackBuffer);
}

void clearBuffer(int myBuffer[])
{
	for(int i=0; i < MAXROW; i++)
	{
		myBuffer[i]=0;
	}
}


void shiftLeft(int myBuffer[])
{
	for(int i=0; i<14; i++)
	{
		myBuffer[i]=myBuffer[i+1];
	}
	myBuffer[14]=0;
}



void setImage(int iImgNum)
{
	switch(iImgNum)
	{
	case 0: //Middle Finger
		iBackBuffer[0]=0b0000000000;
		iBackBuffer[1]=0b0000000000;
		iBackBuffer[2]=0b0000000000;
		iBackBuffer[3]=0b0000000000;
		iBackBuffer[4]=0b0001110000;
		iBackBuffer[5]=0b1111110000;
		iBackBuffer[6]=0b1111111110;
		iBackBuffer[7]=0b1111110000;
		iBackBuffer[8]=0b0001110000;
		iBackBuffer[9]=0b0001100000;
		iBackBuffer[10]=0b0000000000;
		iBackBuffer[11]=0b0000000000;
		iBackBuffer[12]=0b0000000000;
		iBackBuffer[13]=0b0000000000;
		iBackBuffer[14]=0b0000000000;
		break;
	case 1: //TURKEY!!!
		iBackBuffer[0]=0b0000000000;
		iBackBuffer[1]=0b0000000000;
		iBackBuffer[2]=0b0000000111;
		iBackBuffer[3]=0b0000000011;
		iBackBuffer[4]=0b1000111111;
		iBackBuffer[5]=0b1111111000;
		iBackBuffer[6]=0b0001111000;
		iBackBuffer[7]=0b1001111000;
		iBackBuffer[8]=0b1111111000;
		iBackBuffer[9]=0b0000111000;
		iBackBuffer[10]=0b0000011100;
		iBackBuffer[11]=0b0000111111;
		iBackBuffer[12]=0b0000011110;
		iBackBuffer[13]=0b0000001100;
		iBackBuffer[14]=0b0000000000;
		break;
	case 2: //CBU DESIGN
		iBackBuffer[0]=0b0001111111;
		iBackBuffer[1]=0b0001111111;
		iBackBuffer[2]=0b0001100011;
		iBackBuffer[3]=0b0001100011;
		iBackBuffer[4]=0b0001100011;
		iBackBuffer[5]=0b0001100011;
		iBackBuffer[6]=0b0001100011;
		iBackBuffer[7]=0b0001100011;
		iBackBuffer[8]=0b0001111111;
		iBackBuffer[9]=0b0001111111;
		iBackBuffer[10]=0b0000000000;
		iBackBuffer[11]=0b0110000000;
		iBackBuffer[12]=0b0110000000;
		iBackBuffer[13]=0b0000000000;
		iBackBuffer[14]=0b1000000000;
		break;
/*	case 3: //Brightness test pattern
		iBackBuffer[0]=0b1000000000;
		iBackBuffer[1]=0b1100000000;
		iBackBuffer[2]=0b1110000000;
		iBackBuffer[3]=0b1111000000;
		iBackBuffer[4]=0b1111100000;
		iBackBuffer[5]=0b1111110000;
		iBackBuffer[6]=0b1111111000;
		iBackBuffer[7]=0b1111111100;
		iBackBuffer[8]=0b1111111110;
		iBackBuffer[9]=0b1111111111;
		iBackBuffer[10]=0b0111111111;
		iBackBuffer[11]=0b0011111111;
		iBackBuffer[12]=0b0001111111;
		iBackBuffer[13]=0b0000000011;
		iBackBuffer[14]=0b1111111111;
		break;
	case 4: //Full on test
		iBackBuffer[0]=0b1111111111;
		iBackBuffer[1]=0b1111111111;
		iBackBuffer[2]=0b1111111111;
		iBackBuffer[3]=0b1111111111;
		iBackBuffer[4]=0b1111111111;
		iBackBuffer[5]=0b1111111111;
		iBackBuffer[6]=0b1111111111;
		iBackBuffer[7]=0b1111111111;
		iBackBuffer[8]=0b1111111111;
		iBackBuffer[9]=0b1111111111;
		iBackBuffer[10]=0b1111111111;
		iBackBuffer[11]=0b1111111111;
		iBackBuffer[12]=0b1111111111;
		iBackBuffer[13]=0b1111111111;
		iBackBuffer[14]=0b1111111111;
		break;
*/	case 5:	//Meat boy
	    iBackBuffer[0]=0b0000010000;
		iBackBuffer[1]=0b0000010000;
		iBackBuffer[2]=0b0111111100;
		iBackBuffer[3]=0b0100000100;
		iBackBuffer[4]=0b1100000100;
		iBackBuffer[5]=0b0101010100;
		iBackBuffer[6]=0b0101100100;
		iBackBuffer[7]=0b1101010100;
		iBackBuffer[8]=0b0100000100;
		iBackBuffer[9]=0b0111111100;
		iBackBuffer[10]=0b0000010000;
		iBackBuffer[11]=0b0000010000;
		iBackBuffer[12]=0b0000000000;
		iBackBuffer[13]=0b0000000000;
		iBackBuffer[14]=0b0000000000;
		break;
/*	case 6: //CAVAD right
		iBackBuffer[0]=0b0000000000;
		iBackBuffer[1]=0b0000000000;
		iBackBuffer[2]=0b0000110000;
		iBackBuffer[3]=0b0011111100;
		iBackBuffer[4]=0b0111111110;
		iBackBuffer[5]=0b0111111110;
		iBackBuffer[6]=0b1101111011;
		iBackBuffer[7]=0b1100110011;
		iBackBuffer[8]=0b1110000111;
		iBackBuffer[9]=0b0111001110;
		iBackBuffer[10]=0b0111111110;
		iBackBuffer[11]=0b0011111100;
		iBackBuffer[12]=0b0000110000;
		iBackBuffer[13]=0b0000000000;
		iBackBuffer[14]=0b0000000000;
		break;
	case 7: //CAVAD down
		iBackBuffer[0]=0b0000000000;
		iBackBuffer[1]=0b0000000000;
		iBackBuffer[2]=0b0000110000;
		iBackBuffer[3]=0b0011111100;
		iBackBuffer[4]=0b0111100110;
		iBackBuffer[5]=0b0111001110;
		iBackBuffer[6]=0b1110011111;
		iBackBuffer[7]=0b1100111111;
		iBackBuffer[8]=0b1110011111;
		iBackBuffer[9]=0b0111001110;
		iBackBuffer[10]=0b0111100110;
		iBackBuffer[11]=0b0011111100;
		iBackBuffer[12]=0b0000110000;
		iBackBuffer[13]=0b0000000000;
		iBackBuffer[14]=0b0000000000;
		break;
	case 8: //CAVAD left
	    iBackBuffer[0]=0b0000000000;
		iBackBuffer[1]=0b0000000000;
		iBackBuffer[2]=0b0000110000;
		iBackBuffer[3]=0b0011111100;
		iBackBuffer[4]=0b0111111110;
		iBackBuffer[5]=0b0111001110;
		iBackBuffer[6]=0b1110000111;
		iBackBuffer[7]=0b1100110011;
		iBackBuffer[8]=0b1101111011;
		iBackBuffer[9]=0b0111111110;
		iBackBuffer[10]=0b0111111110;
		iBackBuffer[11]=0b0011111100;
		iBackBuffer[12]=0b0000110000;
		iBackBuffer[13]=0b0000000000;
		iBackBuffer[14]=0b0000000000;
		break;
	case 9: //CAVAD up
		iBackBuffer[0]=0b0000000000;
		iBackBuffer[1]=0b0000000000;
		iBackBuffer[2]=0b0000110000;
		iBackBuffer[3]=0b0011111100;
		iBackBuffer[4]=0b0110011110;
		iBackBuffer[5]=0b0111001110;
		iBackBuffer[6]=0b1111100111;
		iBackBuffer[7]=0b1111110011;
		iBackBuffer[8]=0b1111100111;
		iBackBuffer[9]=0b0111001110;
		iBackBuffer[10]=0b0110011110;
		iBackBuffer[11]=0b0011111100;
		iBackBuffer[12]=0b0000110000;
		iBackBuffer[13]=0b0000000000;
		iBackBuffer[14]=0b0000000000;
*/		break;
	case 10: //Smile 1
 		iBackBuffer[0]=0b0000000000;
	    iBackBuffer[1]=0b0000000000;
	    iBackBuffer[2]=0b0000111100;
	    iBackBuffer[3]=0b0100100101;
	    iBackBuffer[4]=0b1000110101;
	    iBackBuffer[5]=0b1000111101;
	    iBackBuffer[6]=0b1000000000;
	    iBackBuffer[7]=0b1011100000;
	    iBackBuffer[8]=0b1010000000;
	    iBackBuffer[9]=0b1000111101;
	    iBackBuffer[10]=0b1000110101;
	    iBackBuffer[11]=0b0100100101;
	    iBackBuffer[12]=0b0000111100;
	    iBackBuffer[13]=0b0000000000;
	    iBackBuffer[14]=0b0000000000;
		break;
	case 11: //Smile 2
	    iBackBuffer[0]=0b0000000000;
    iBackBuffer[1]=0b0000000000;
    iBackBuffer[2]=0b0000111100;
    iBackBuffer[3]=0b0100110101;
    iBackBuffer[4]=0b1000100101;
    iBackBuffer[5]=0b1000111101;
    iBackBuffer[6]=0b1000000000;
    iBackBuffer[7]=0b1011100000;
    iBackBuffer[8]=0b1010000000;
    iBackBuffer[9]=0b1000111101;
    iBackBuffer[10]=0b1000110101;
    iBackBuffer[11]=0b0100100101;
    iBackBuffer[12]=0b0000111100;
    iBackBuffer[13]=0b0000000000;
    iBackBuffer[14]=0b0000000000;
    break;
    case 12: //Smile 3
        iBackBuffer[0]=0b0000000000;
    iBackBuffer[1]=0b0000000000;
    iBackBuffer[2]=0b0000111100;
    iBackBuffer[3]=0b0100101101;
    iBackBuffer[4]=0b1000100101;
    iBackBuffer[5]=0b1000111101;
    iBackBuffer[6]=0b1000000000;
    iBackBuffer[7]=0b1011100000;
    iBackBuffer[8]=0b1010000000;
    iBackBuffer[9]=0b1000111101;
    iBackBuffer[10]=0b1000101101;
    iBackBuffer[11]=0b0100100101;
    iBackBuffer[12]=0b0000111100;
    iBackBuffer[13]=0b0000000000;
    iBackBuffer[14]=0b0000000000;
    break;
    case 13: //Smile 4
        iBackBuffer[0]=0b0000000000;
    iBackBuffer[1]=0b0000000000;
    iBackBuffer[2]=0b0000111100;
    iBackBuffer[3]=0b0100100101;
    iBackBuffer[4]=0b1000101101;
    iBackBuffer[5]=0b1000111101;
    iBackBuffer[6]=0b1000000000;
    iBackBuffer[7]=0b1011100000;
    iBackBuffer[8]=0b1010000000;
    iBackBuffer[9]=0b1000111101;
    iBackBuffer[10]=0b1000100101;
    iBackBuffer[11]=0b0100101101;
    iBackBuffer[12]=0b0000111100;
    iBackBuffer[13]=0b0000000000;
    iBackBuffer[14]=0b0000000000;
    break;
    case 14: //Smile 5
        iBackBuffer[0]=0b0000000000;
    iBackBuffer[1]=0b0000000000;
    iBackBuffer[2]=0b0000111100;
    iBackBuffer[3]=0b0100100101;
    iBackBuffer[4]=0b1000110101;
    iBackBuffer[5]=0b1000111101;
    iBackBuffer[6]=0b1000000000;
    iBackBuffer[7]=0b1011100000;
    iBackBuffer[8]=0b1010000000;
    iBackBuffer[9]=0b1000111101;
    iBackBuffer[10]=0b1000100101;
    iBackBuffer[11]=0b0100110101;
    iBackBuffer[12]=0b0000111100;
    iBackBuffer[13]=0b0000000000;
    iBackBuffer[14]=0b0000000000;
    break;
    case 15: //Smile Blink
        iBackBuffer[0]=0b0000000000;
    iBackBuffer[1]=0b0000000000;
    iBackBuffer[2]=0b0000010000;
    iBackBuffer[3]=0b0100010010;
    iBackBuffer[4]=0b1000010010;
    iBackBuffer[5]=0b1000010010;
    iBackBuffer[6]=0b1000000000;
    iBackBuffer[7]=0b1011100000;
    iBackBuffer[8]=0b1010000000;
    iBackBuffer[9]=0b1000010010;
    iBackBuffer[10]=0b1000010010;
    iBackBuffer[11]=0b0100010010;
    iBackBuffer[12]=0b0000010000;
    iBackBuffer[13]=0b0000000000;
    iBackBuffer[14]=0b0000000000;
    break;
	}
}

void setChar(char cChar, int iPosition, int myBuffer[])
{
	int iCharImage[7] = {0,0,0,0,0,0,0};

	alphabet(cChar, iCharImage);

	int iIndex = iPosition * 8;
	int j=0;

	for(int i=iIndex; i<iIndex+7; i++)
	{
		myBuffer[i]=iCharImage[j];
		j++;
	}

}

void alphabet(int iASCII, int myImage[])
{

	int iCol[7]={0,0,0,0,0,0,0};

	switch(iASCII)
	{

case 32:
	iCol[0]=0b0000000000;
	iCol[1]=0b0000000000;
	iCol[2]=0b0000000000;
	iCol[3]=0b0000000000;
	iCol[4]=0b0000000000;
	iCol[5]=0b0000000000;
	iCol[6]=0b0000000000;
	break;
case 45:
    iCol[0]=0b0000000000;
    iCol[1]=0b0000110000;
    iCol[2]=0b0000110000;
    iCol[3]=0b0000110000;
    iCol[4]=0b0000110000;
    iCol[5]=0b0000110000;
    iCol[6]=0b0000000000;
     break;
case 46:
    iCol[0]=0b0000000000;
    iCol[1]=0b0000000000;
    iCol[2]=0b1110000000;
    iCol[3]=0b1110000000;
    iCol[4]=0b1110000000;
    iCol[5]=0b0000000000;
    iCol[6]=0b0000000000;
     break;
case 65:	//A
    iCol[0]=0b1111111100;
    iCol[1]=0b1111111110;
    iCol[2]=0b0001100011;
    iCol[3]=0b0001100011;
    iCol[4]=0b0001100011;
    iCol[5]=0b1111111110;
    iCol[6]=0b1111111100;
     break;
case 66:	//B
    iCol[0]=0b1111111111;
    iCol[1]=0b1111111111;
    iCol[2]=0b1100110011;
    iCol[3]=0b1100110011;
    iCol[4]=0b1100110011;
    iCol[5]=0b1111111111;
    iCol[6]=0b1111001111;
     break;
case 67:		//C
    iCol[0]=0b1111111111;
    iCol[1]=0b1111111111;
    iCol[2]=0b1100000011;
    iCol[3]=0b1100000011;
    iCol[4]=0b1100000011;
    iCol[5]=0b1100000011;
    iCol[6]=0b1100000011;
     break;
case 68:		//D
    iCol[0]=0b1111111111;
    iCol[1]=0b1111111111;
    iCol[2]=0b1100000011;
    iCol[3]=0b1100000011;
    iCol[4]=0b0110000110;
    iCol[5]=0b0011111100;
    iCol[6]=0b0001111000;
     break;
case 69: 	//E
    iCol[0]=0b1111111111;
    iCol[1]=0b1111111111;
    iCol[2]=0b1100110011;
    iCol[3]=0b1100110011;
    iCol[4]=0b1100110011;
    iCol[5]=0b1100000011;
    iCol[6]=0b1100000011;
     break;
case 70:	//F
    iCol[0]=0b1111111111;
    iCol[1]=0b1111111111;
    iCol[2]=0b0000110011;
    iCol[3]=0b0000110011;
    iCol[4]=0b0000110011;
    iCol[5]=0b0000110011;
    iCol[6]=0b0000000011;
     break;
case 71:	//G
    iCol[0]=0b1111111111;
    iCol[1]=0b1111111111;
    iCol[2]=0b1100000011;
    iCol[3]=0b1100100011;
    iCol[4]=0b1100100011;
    iCol[5]=0b1111100011;
    iCol[6]=0b1111100011;
     break;
case 72:	//H
    iCol[0]=0b1111111111;
    iCol[1]=0b1111111111;
    iCol[2]=0b0000110000;
    iCol[3]=0b0000110000;
    iCol[4]=0b0000110000;
    iCol[5]=0b1111111111;
    iCol[6]=0b1111111111;
     break;
case 73:	//I
    iCol[0]=0b1100000011;
    iCol[1]=0b1100000011;
    iCol[2]=0b1111111111;
    iCol[3]=0b1111111111;
    iCol[4]=0b1111111111;
    iCol[5]=0b1100000011;
    iCol[6]=0b1100000011;
     break;
case 74:	//J
    iCol[0]=0b0111000011;
    iCol[1]=0b1111000011;
    iCol[2]=0b1100000011;
    iCol[3]=0b1111111111;
    iCol[4]=0b0111111111;
    iCol[5]=0b0000000011;
    iCol[6]=0b0000000011;
     break;
case 75:	//K
    iCol[0]=0b1111111111;
    iCol[1]=0b1111111111;
    iCol[2]=0b0001111000;
    iCol[3]=0b0011011100;
    iCol[4]=0b0110000110;
    iCol[5]=0b1100000011;
    iCol[6]=0b1000000000;
     break;
case 76:	//L
    iCol[0]=0b1111111111;
    iCol[1]=0b1111111111;
    iCol[2]=0b1100000000;
    iCol[3]=0b1100000000;
    iCol[4]=0b1100000000;
    iCol[5]=0b1100000000;
    iCol[6]=0b1100000000;
     break;
case 77:	//M
    iCol[0]=0b1111111111;
    iCol[1]=0b1111111111;
    iCol[2]=0b0000001110;
    iCol[3]=0b0000011100;
    iCol[4]=0b0000001110;
    iCol[5]=0b1111111111;
    iCol[6]=0b1111111111;
     break;
case 78:	//N
    iCol[0]=0b1111111111;
    iCol[1]=0b1111111111;
    iCol[2]=0b0001111100;
    iCol[3]=0b0011110000;
    iCol[4]=0b0111100000;
    iCol[5]=0b1111111111;
    iCol[6]=0b1111111111;
     break;
case 79:	//O
    iCol[0]=0b1111111111;
    iCol[1]=0b1111111111;
    iCol[2]=0b1100000011;
    iCol[3]=0b1100000011;
    iCol[4]=0b1100000011;
    iCol[5]=0b1111111111;
    iCol[6]=0b1111111111;
     break;
case 80:	//P
    iCol[0]=0b1111111111;
    iCol[1]=0b1111111111;
    iCol[2]=0b0000110011;
    iCol[3]=0b0000110011;
    iCol[4]=0b0000110011;
    iCol[5]=0b0000111111;
    iCol[6]=0b0000111111;
     break;
case 81:	//Q
    iCol[0]=0b1111111111;
    iCol[1]=0b1111111111;
    iCol[2]=0b1100000011;
    iCol[3]=0b1110000011;
    iCol[4]=0b1111111111;
    iCol[5]=0b1111111111;
    iCol[6]=0b1100000000;
     break;
case 82:	//R
    iCol[0]=0b1111111111;
    iCol[1]=0b1111111111;
    iCol[2]=0b0001110011;
    iCol[3]=0b0011110011;
    iCol[4]=0b0110110011;
    iCol[5]=0b1100111111;
    iCol[6]=0b1000111111;
     break;
case 83:	//S
    iCol[0]=0b1100111111;
    iCol[1]=0b1100111111;
    iCol[2]=0b1100110011;
    iCol[3]=0b1100110011;
    iCol[4]=0b1100110011;
    iCol[5]=0b1111110011;
    iCol[6]=0b1111110011;
     break;
case 84:	//T
    iCol[0]=0b0000000011;
    iCol[1]=0b0000000011;
    iCol[2]=0b1111111111;
    iCol[3]=0b1111111111;
    iCol[4]=0b1111111111;
    iCol[5]=0b0000000011;
    iCol[6]=0b0000000011;
     break;
case 85:	//U
    iCol[0]=0b1111111111;
    iCol[1]=0b1111111111;
    iCol[2]=0b1100000000;
    iCol[3]=0b1100000000;
    iCol[4]=0b1100000000;
    iCol[5]=0b1111111111;
    iCol[6]=0b1111111111;
     break;
case 86:	//V
    iCol[0]=0b0011111111;
    iCol[1]=0b0111111111;
    iCol[2]=0b1110000000;
    iCol[3]=0b1100000000;
    iCol[4]=0b1110000000;
    iCol[5]=0b0111111111;
    iCol[6]=0b0011111111;
     break;
case 87:	//W
    iCol[0]=0b1111111111;
    iCol[1]=0b1111111111;
    iCol[2]=0b1100000000;
    iCol[3]=0b1111000000;
    iCol[4]=0b1100000000;
    iCol[5]=0b1111111111;
    iCol[6]=0b1111111111;
     break;
case 88:	//X
    iCol[0]=0b1100000011;
    iCol[1]=0b1111001111;
    iCol[2]=0b0011111100;
    iCol[3]=0b0011111100;
    iCol[4]=0b1111001111;
    iCol[5]=0b1100000011;
    iCol[6]=0b0000000000;
     break;
case 89:	//Y
    iCol[0]=0b0000001111;
    iCol[1]=0b0000011110;
    iCol[2]=0b1111110000;
    iCol[3]=0b1111110000;
    iCol[4]=0b0000011110;
    iCol[5]=0b0000001111;
    iCol[6]=0b0000000000;
     break;
case 90:	//Z
    iCol[0]=0b1111000011;
    iCol[1]=0b1111100011;
    iCol[2]=0b1100110011;
    iCol[3]=0b1100010011;
    iCol[4]=0b1100011011;
    iCol[5]=0b1100001111;
    iCol[6]=0b1100001111;
     break;
	}

	myImage[0] = iCol[0];
    myImage[1] = iCol[1];
    myImage[2] = iCol[2];
    myImage[3] = iCol[3];
    myImage[4] = iCol[4];
    myImage[5] = iCol[5];
    myImage[6] = iCol[6];

}

Thomas Renck

I make things. Sometimes I un-make things. Most of the time I write code and teach on intentionality in design.