Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/19/05 21:23
Read: times


 
#105556 - Knight Rider LED pattern Software
Responding to: ???'s previous message
Hello Jan,

I will corrent the schematic as you indicated.
Below is a c program which will emulate the popular Knight rider (Popular 70's TV) LED's.

Regards,

Charles Bannister

/*         XmasLitsBlink.c http://www.8052.com/forum/read.phtml?id=105529*/
/*         Subject: open project: christmas lightchain */
//         compile SDCC.EXE XmasLitsBlink.c
//         PACKIHX.EXE XmasLitsBlink.ihz > XmasLitsBlink.hex

           #include <AT89X52.H>

//******************Prototype Declaration's*******************
            void delay(unsigned int del_val);
            void shift(unsigned int n);

//******************Definitions*******************************
        #define CLOCK1 P2_7                     // 89C52 pin 27
        #define DOUT P2_6                       // 89C52 pin 26

void main (void)

{
  unsigned char i;                              /* General var */
  unsigned int n;                               /* LED var */
  while (1)  {                                  /* Loop forever */
        n = 0x8000;
        for (i=0; i<15; ++i){
          shift ( n );
          n>>=1;                                // shift right one bit
          delay(100);                           /* delay 100 milliseconds */
        }

        n = 0x0001;                             // Shift left 16 bits delay 100 ms
        for (i=0; i<15; ++i){
          shift ( n );
          n<<=1;                                // shift left one bit
          delay(100);                           /* delay 100 milliseconds */
        }
        }

}
//************************************************************
// shift 16-bit data
//************************************************************

void shift(unsigned int n)
{
        char j;
        for(j=0; j<16; j++)
        {
                DOUT = n&0x8000;                // send data
                CLOCK1 = 1;
                CLOCK1 = 0;
                n<<=1;                          // shift left one bit
        }
}

//************************************************************
//      delay function ie delay(Ms). Based on 11.059200 MHz
//************************************************************
 void delay(unsigned int del_val)
 {
        int i,k;
           for(i=0;i<=del_val;i++)
           for(k=0;k<=111;k++);
 }


:040000000200F032D8
:01000B0032C2
:0100130032BA
:01001B0032B2
:0100230032AA
:01002B0032A2
:1000F0007581071200ECE582600302002C7900E9AB
:100100004400601B7A00900138780075A000E493E9
:10011000F2A308B8000205A0D9F4DAF275A0FF78BE
:1001200000E84400600C7900900000E4F0A3D8FCE3
:08013000D9FAF6D8FD02002CFB
:10002C0012003180FE7A007B807C0F8A828B83C029
:10003C0002C003C00412009CD004D003D002EBC356
:10004C0013CA13CAFB900064C002C003C0041200A0
:10005C00C4D004D003D002DCD27A017B007C0F8A9E
:10006C00828B83C002C003C00412009CD004D00356
:10007C00D002EBCA25E0CA33FB900064C002C00377
:10008C00C0041200C4D004D003D002DCD28096226B
:10009C00AA82AB837C00C3EC6480949050197D00E1
:1000AC0074805BFE4D24FF92A6D2A7C2A7EBCA2593
:1000BC00E0CA33FB0C80DF22AA82AB837C007D007C
:1000CC008C068D07C3EA9EEB9F40147E707F001E4A
:1000DC00BEFF011FEE4F70F70CBC00E40D80E12257
:0400EC0075820022F7
:00000001FF


List of 28 messages in thread
TopicAuthorDate
open project: christmas lightchain            01/01/70 00:00      
   Take care...            01/01/70 00:00      
      with music too            01/01/70 00:00      
      Thanks for warning, Kai            01/01/70 00:00      
         Looks nice!            01/01/70 00:00      
   OK, count me in. Here's Schematic            01/01/70 00:00      
      software            01/01/70 00:00      
         Knight Rider LED pattern Software            01/01/70 00:00      
            Knight Rider            01/01/70 00:00      
   Another option            01/01/70 00:00      
      Knight Rider Software Corrected            01/01/70 00:00      
   Too much time            01/01/70 00:00      
      some more led sequencers            01/01/70 00:00      
         variations            01/01/70 00:00      
      tastes great; less filling            01/01/70 00:00      
         I was wondering which one it would be.            01/01/70 00:00      
         beer            01/01/70 00:00      
            beer            01/01/70 00:00      
               Sam's Light            01/01/70 00:00      
               better            01/01/70 00:00      
                  who can ever agree on taste            01/01/70 00:00      
                  best beer            01/01/70 00:00      
                     The Henley Rowing Club            01/01/70 00:00      
                        "Authentic"            01/01/70 00:00      
                     Beer tastes            01/01/70 00:00      
                        Sure            01/01/70 00:00      
                  Leffe'            01/01/70 00:00      
   update            01/01/70 00:00      

Back to Subject List