counter

An area to discuss 8-bit PIC specific problems and examples

Moderator: Benj

Post Reply
siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

counter

Post by siliconchip »

hi ive made myself a simple flowchart which will become part of a bigger project but this is increments a count to 12 by each button press then when reaching 12 it decrements to 0 however when counting down past 10 i cant lose the 0, im sure there is a simple solution but ive yet to find it, can someone show me the errors of my ways please :oops:

cheers bob
Attachments
counter.fcfx
(12.17 KiB) Downloaded 262 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: counter

Post by Benj »

Hi Bob,

You could either clear the LCD when you drop out of the first "until scan = 12" loop.

Or you could format the number so the value on the display is always 2 characters.
Counter_Format.png
(10.37 KiB) Downloaded 2082 times

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: counter

Post by siliconchip »

hi benj
as always thanks for the reply, ive tried both of your suggestions and found using the decision box in the second routine works fine, it seems such a simple solution but i couldnt find it :oops: thanks for the tip

cheers bob
Attachments
counter.fcfx
(12.75 KiB) Downloaded 276 times

Post Reply