This blog is created especially for my supervisor, Mr Mazran bin Esro in order to assess my PSM Project named as Home Appliances Control via Power Line Communication.
Wednesday, September 1, 2010
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..
#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
Subscribe to:
Posts (Atom)