Wednesday, September 1, 2010

Running Light Circuit-Proteus..

Design a running light circuit using Proteus Software


After simulation, click Tools>Bill of Materials>HTML output. BOM used for list of component in the circuit.


Monday, August 30, 2010

Basic Running Light Coding

//running light

#include <16f877a.h>
#use delay(clock = 20000000)
#fuses hs,noprotect,nowdt,nolvp

#byte PORTB=6
#byte PORTC=7

main()
{
   set_tris_b(0);
   set_tris_c(0x01);
   do{
      if (portc==0)
      {
         portb=0b01010101;
         delay_ms(1000);
         portb=0b10101010;
         delay_ms(2000);
      }
      else
      {
         portb=0xFF;
         delay_ms(1000);
      }
   }while(1);
}

Output for the coding..


Compile