Tuesday, July 21, 2009

Hacking the TouchShield Slide: Undocumented Easter Egg

Why is open source cool? I got an email from Raj, who’s been using the TouchShield for a while, saying “I noticed there’s an extra RGB LED that I don’t think is supposed to be there.”

To which I replied, “PSYCH! Actually, it’s supposed to be there, and you’re the first person to discover that easter egg!” There are other easter eggs on the TouchShield Slide, but this is the first one that anyone’s found.

Ok, well then I guess it’s time to post some code…here's how to hack it:

void setup()
{

/* Setup pin direction */
SETBIT(DDRD, PD4);//set the red led data direction to output
SETBIT(DDRD, PD5);//set the green led data direction to output
SETBIT(DDRD, PD6);//set the blue led data direction to output

/* Turn on all LEDs */
CLRBIT(PORTD, PD4);//turn on the red led
CLRBIT(PORTD, PD5);//turn on the green led
CLRBIT(PORTD, PD6);//turn on the blue led

}

void loop()
{

/* Turn on all LEDs */
CLRBIT(PORTD, PD4);//turn on the red led
CLRBIT(PORTD, PD5);//turn on the green led
CLRBIT(PORTD, PD6);//turn on the blue led
delay(1000);//wait for 1 second

/* Turn off LEDs */
SETBIT(PORTD, PD4);//turn off the red led
SETBIT(PORTD, PD5);//turn off the green led
SETBIT(PORTD, PD6);//turn off the blue led
delay(1000);//wait for 1 second

/* Blink the RED LED */
CLRBIT(PORTD, PD4);//turn on the red led
delay(1000);//wait for 1 second
SETBIT(PORTD, PD4);//turn off the red led
delay(1000);//wait for 1 second

/* Blink the GREEN LED */
CLRBIT(PORTD, PD5);//turn on the green led
delay(1000);//wait for 1 second
SETBIT(PORTD, PD5);//turn off the green led
delay(1000);//wait for 1 second

/* Blink the BLUE LED */
CLRBIT(PORTD, PD6);//turn on the blue led
delay(1000);//wait for 1 second
SETBIT(PORTD, PD6);//turn off the blue led
delay(1000);//wait for 1 second



Unbeknownst to everyone who’s ever bought a TouchShield slide, there’s actually a multi-color RGB LED backlight on the reverse side of the board. This lets someone set “mood lighting” for a gadget – eat that, iPod…


2 comments:

Justin Wind said...

Speaking of, where are the schematics and bootloader code available from? I was never able to track them down.
Adding links to such useful things on the product page would be a nice touch.. :)

Unknown said...

OK, see now I'm going to have to add that to GAMEPAX. Very cool guys.