Pages

Wednesday, November 30, 2011

Batteryless Persistence- of-Vision Toy

Design a batteryless POV toy that is programmed with text and graphics patterns in a microcontroller. The toy uses seven LEDs arranged in a column, which is waved through the air. These LEDs are controlled by the microcontroller, which generates a pattern of light on the LEDs that an external observer sees as a message or graphics due to the persistence of vision. The operating power for the toy is derived from the Faraday generator.


//Make: H
const char MSG[] PROGMEM= {0x80, 0xfd,0xfb, 0xf7, 0xfb, 0xfd, 0x80, 0xff,0xdd,0xae,0xb6, 0xb6, 0xb9, 0xc3,0xbf, 0xff, 0x80, 0xf7, 0xeb, 0xdd,0xbe,0xff, 0xe3, 0xcd,0xad, 0xad,0xb3, 0xff, 0xff, 0x93, 0x93, 0xff,0xf3, 0xe1, 0xc0, 0xc0,0xc1,0x87,0x87, 0xc1, 0xc0, 0xc0, 0xe1, 0xf3,0xff, 0xff};
//size: 45 bytes
#define maxchar 45
void main(void)
{
unsigned char temp;
DDRA= 0x7f;
PORTA=255;
while(1)
{
PORTA = 255;
while( (PINA&0x80) == 0x80);
while( (PINA&0x80) == 0);
_delay_loop_2(3000);
while( (PINA&0x80) == 0);
_delay_loop_2(1000);
for(temp=0; temp
{
PORTA= pgm_read_byte(&MSG[temp]);
_delay_loop_2(150);
PORTA=0xff;
_delay_loop_2(50);
}
}
}

Note: Only logical things are given in the program....

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...