In this code.. the C.Ct is displaying in descending order.. I tried out the increment operator too.. If I used the ++ operator then the led is not stopping at the correct count. How can we modify the code..?
I have given the code above.. The code is about.. if we press the button 5 times, the led will blink for 5 times... at the same time., In the lcd it should print the count. Here in this program when I press 5 times the button, it is displaying the total count (T.Ct) properly, but the led blinking count (C.Ct) is displaying in descending order(5..4..3..2..1) since I have decremented the butCnt. But I need that to display in incrementing order ex..1..2...3...4...5. I have tried the ++ operator changed the code to print the k (in code) value., if I give that, then the led is not stopping at exact count.. its blinking forever..
for (int k=0 ; k < butCnt; k++) {
lcd.setCursor(7,0);
lcd.print("C.Ct:");
lcd.setCursor(7,1);
lcd.print(k);
[/quote]
Did you really want "butCnt" to be zero after the blinks? You could keep that 'feature' by adding "butCnt = 0;" after the blink loop. I don't see how your count would ever go above 1.