hi all,
i got a problem here with my program, i create 2 toggle light. but i cannot control the light 2 at the same time. if i want to control the other light, i need to reset the pic first. can somebody help me so i can control both my light so i dont need to reset my pic anymore. below are my program.
thanks...
#include <16f877A.h>
#fuses HS,NOLVP,NOWDT
#use delay (clock=20000000)
void wait_for_one_press1() {
while(!input(PIN_B1)) ;
delay_ms (100);
while(input(PIN_B1)) ;
}
void wait_for_one_press2() {
while(!input(PIN_B0)) ;
delay_ms (100);
while(input(PIN_B0)) ;
}
void main () {
while (TRUE) {
if (!input (PIN_B1))
{
wait_for_one_press1();
output_toggle(PIN_B7);
}
else if (!input (PIN_B0))
{
wait_for_one_press2();
output_toggle(PIN_B6);
}
}
}