BGAmodz
Member
I have been reading a lot of tutorials the last days and i have managed to write a program for a dual blinking leds with switch .
I have completed the program using the C language , but when i load it on the PIC16F877A it does not apply it .
Here is a copy of the program :
int i ;
sbit sw at porta.b0 ;
sbit led_1 at porta.b1 ;
sbit led_2 at porta.b2 ;
void main () {
trisa.b0=1 ;
trisa.b1=0 ;
trisa.b2=0 ;
while(1) {
if(sw==1){
for(i=0;i<=5;++i){
led_1=1 ;
led_2=0 ;
delay_ms(1000) ;
led_1=0;
led_2=1;
delay_ms(1000);
}
}
else(led_1=0 )&&(led_2=0);
}
}
I have completed the program using the C language , but when i load it on the PIC16F877A it does not apply it .
Here is a copy of the program :
int i ;
sbit sw at porta.b0 ;
sbit led_1 at porta.b1 ;
sbit led_2 at porta.b2 ;
void main () {
trisa.b0=1 ;
trisa.b1=0 ;
trisa.b2=0 ;
while(1) {
if(sw==1){
for(i=0;i<=5;++i){
led_1=1 ;
led_2=0 ;
delay_ms(1000) ;
led_1=0;
led_2=1;
delay_ms(1000);
}
}
else(led_1=0 )&&(led_2=0);
}
}
