Pages

Wednesday, November 30, 2011

Spinning LED Top with Message Display



               Once the top is soldered, the batteries are installed and the microcontroller is programmed with the application code available from our website, using the ISP interface. Once the microcontroller is programmed, the ISP cable is removed and the power switch is turned on. Gently hold the axle of the top between the palms, spin the top, and let it go on a solid flat surface. You will see messages appear. It may take a bit of practice to spin the top. Let the top stop spinning, and now spin it in the other direction and a different message will appear. Make sure you turn the power switch off when the top is not in use.


Logic is here:
void double_string_display (void)
{
// Initialize display
construct_display_field();
// TOP runs
while (running_condition() == TOP_TURNING)
{
i = current_column/2;
if(current_column%2==1)
{
set_leds(LED_ALL_OFF);
}
else if(current_column%2==0)
{
if(mode==CLOCKWISE)
{
if(i<=(STRING_LENGTH1*6))
set_leds((display_field_clock[i])&0x7F);
else
set_leds(LED_ALL_OFF);
}
else if(mode==ANTICLOCKWISE)
{
if(((STRING_LENGTH2*6)-i)>=0)
set_leds((display_field_clock[(STRING_LENGTH2*6)-i])&0x7F);
else
set_leds(LED_ALL_OFF);
}
}
}
// TOP does not run
while(running_condition() != TOP_TURNING)
{
// Disable all leds
set_leds(LED_ALL_OFF);
}
} /* double_string_display */

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...