I have to make a very simple program for led blinking .
Using buttons 1 and 6 lead me.When the button is pressed for a small time , then Led 1 should
be blinking.
This code is part 2 of the LED blink.
part 1- Lead 5 & 6
part 2- LED 1,2,3 & 4 blinking with batton scan
As long as the button is not pressed until the LED blinks 5-6
But when the button is pressed more then 2 sec & unpressed,led1 blink 12sec . ofter 12 sec part
1 agen run.
But when the button is agen pressed more then 10 sec & unpressed during 12 sec of led1 blinking
.led 1 off & led2 blinking 15 sec ,
But when the button is agen pressed more then 2 sec & unpressed,during 15 sec led3 blink & led2 off.
But when the button is agen pressed more then 2 sec & unpressed,during 15 sec led4 blink & led3 off.
now when the button is agen pressed more then 2 sec & unpressed part 1 agen run.
i has try but not get sessss
PHP:
if(RA4 ==0)
{ led1 = 1;
led2 = 0;
led3 = 0;
led4=0;
// tcnt++;
tcnt=tcnt+1;
if(tcnt == 2)
{ sp++;
if(sp>=1 )
{ led1 = 0;
led2 = 1;
led3 = 0;
led4=0;
//tcnt=tcnt+1;
}
if(sp==3 ) {led1 = 0;
led2 = 0;
led3 = 1;
led4=0;
//tcnt=tcnt+1;
}
tcnt =0;sp=0;
}
if(RA4 =1)
{ led5=~led5;
led6=~led6;}