Page 1 of 1

counter

Posted: Mon Jun 04, 2018 10:51 am
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

Re: counter

Posted: Mon Jun 04, 2018 11:05 am
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

Re: counter

Posted: Mon Jun 04, 2018 12:46 pm
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