gonzalza
Joined: 23 Feb 2010 Posts: 12
|
16f877 outputb problem [Solved] |
Posted: Tue Mar 02, 2010 9:21 am |
|
|
The program is working well, but just the last part and b6 it are not working. What happen?
Code: |
if(!input(PIN_B5)){
output_high(PIN_C1);
delay_ms(500);
|
Code: |
#include "16f877.h"
#use delay(clock=4000000)
#fuses HS,NOWDT,PUT,NOPROTECT,NOLVP
void main()
{
set_tris_b(0xff);
set_tris_c(0x00);
set_tris_d(0xff);
output_C(0);
while (1)
{
if(!input(PIN_B0)){
output_high(PIN_C0);delay_ms(500);
}
if(!input(PIN_B1)){
output_high(PIN_C1);
delay_ms(500);
}
if(!input(PIN_B2)){
output_high(PIN_C2);
delay_ms(500);
}
if(!input(PIN_B3)){
output_high(PIN_C3);
delay_ms(500);
}
if(!input(PIN_B4)){
output_high(PIN_C4);
delay_ms(500);}
}
if(!input(PIN_B5)){
output_high(PIN_C1);
delay_ms(500);
}
if(!input(PIN_B6)){
output_high(PIN_C1);
delay_ms(500);
}
}
|
|
|