PIC1684F - Counter reset(SOLVED)

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
Carl_Smith93
Posts: 4
Joined: Sat Nov 09, 2013 7:17 pm
Has thanked: 4 times

PIC1684F - Counter reset(SOLVED)

Post by Carl_Smith93 »

----------------------------
Last edited by Carl_Smith93 on Sat Nov 16, 2013 5:28 pm, edited 1 time in total.

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times

Re: PIC1684F - Counter reset

Post by kersing »

Does the attached code do what you want?
Attachments
FFC Count100Reset.fcfx
(8.24 KiB) Downloaded 331 times
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Carl_Smith93
Posts: 4
Joined: Sat Nov 09, 2013 7:17 pm
Has thanked: 4 times

Re: PIC1684F - Counter reset

Post by Carl_Smith93 »

I can't open it.

I am getting the error.

Failed to open document. Attribute<array> is not found.

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: PIC1684F - Counter reset

Post by medelec35 »

Hi Carl,
Can you make sure your running the latest version of 6.0.3?
You can look in 'Help', 'Check for updates'
or
'Help', 'about Flowcode' to check.
Martin

Carl_Smith93
Posts: 4
Joined: Sat Nov 09, 2013 7:17 pm
Has thanked: 4 times

Re: PIC1684F - Counter reset

Post by Carl_Smith93 »

------------------------------------------------
Last edited by Carl_Smith93 on Sat Nov 16, 2013 5:28 pm, edited 1 time in total.

balles
Posts: 31
Joined: Fri Sep 06, 2013 1:37 pm
Has thanked: 16 times
Been thanked: 12 times

Re: PIC1684F - Counter reset

Post by balles »

Dear Carl,

i taked a fast look on your flowchart and as i see, it's working as you're expecting. It counts till 100 and then reset the counter. It just does not reset the display after reach 100.
It's not counting till 199, that number 1 you see in front the 99 is the 1 showed when count = 100. You just need to clean the display, so the 1 of 100 will disaper an it will look as you wish.

Cheers!

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times

Re: PIC1684F - Counter reset

Post by kersing »

Carl_Smith93 wrote: Not exactly , as the way I need do is like so :

If the number is less then 9.

Output : 0,1,2,3,4,5,6,7,8,9 in a single segment of display-- nothing else can be displayed in the others hence why I used decision/if.(3) = segment

If the number is less then 19 but more then 9.

Output:10(3,2) 11(3,2)12(3,2)13(3,2) and so on until the number is 19 which would need a additional if statement for 21,22,23 etc.

So, at this point :: For 1 - 9 their will be 1 segment in use at the time.

When you gets 10 - 99 their will be 2 segments being used at one time(so to speak).

When you get to 100 their will be 3 segments being used at one time.
This will only work once. As soon as a digit has been used that value will stay visible. So once three digits have been used to display 100 you can not erase the second and third digit. This means the display will show 100, 200, 300, 400 etc when it should show 1, 2, 3, 4...
Carl_Smith93 wrote: But, when what you have done, is their any of doin the process but making it show up 100 rather then 99? (Edit) -- Additional: Possible to get to count upto 100& reset to 000?
To show 000 to 100:
Add another led_7seg_quad1::ShowDigit1 macro with arguments 0, Number/100, 0.
Change Decision to: Number > 100
Carl_Smith93 wrote: I would like is possible to reset the counter on the file uploaded? If, so how?
Count is read from the position of the switch (Input icon A4->Count). Reset would mean changing the position of the switch lever. This can be done in simulation, but not in hardware (without mechanical components).
What do you want to achieve?
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Carl_Smith93
Posts: 4
Joined: Sat Nov 09, 2013 7:17 pm
Has thanked: 4 times

Re: PIC1684F - Counter reset

Post by Carl_Smith93 »

balles wrote:Dear Carl,

i taked a fast look on your flowchart and as i see, it's working as you're expecting. It counts till 100 and then reset the counter. It just does not reset the display after reach 100.
It's not counting till 199, that number 1 you see in front the 99 is the 1 showed when count = 100. You just need to clean the display, so the 1 of 100 will disaper an it will look as you wish.

Cheers!
Ok I understand I'll try that now.

Thanks.

kersing wrote:
Carl_Smith93 wrote: Not exactly , as the way I need do is like so :

If the number is less then 9.

Output : 0,1,2,3,4,5,6,7,8,9 in a single segment of display-- nothing else can be displayed in the others hence why I used decision/if.(3) = segment

If the number is less then 19 but more then 9.

Output:10(3,2) 11(3,2)12(3,2)13(3,2) and so on until the number is 19 which would need a additional if statement for 21,22,23 etc.

So, at this point :: For 1 - 9 their will be 1 segment in use at the time.

When you gets 10 - 99 their will be 2 segments being used at one time(so to speak).

When you get to 100 their will be 3 segments being used at one time.
This will only work once. As soon as a digit has been used that value will stay visible. So once three digits have been used to display 100 you can not erase the second and third digit. This means the display will show 100, 200, 300, 400 etc when it should show 1, 2, 3, 4...
Carl_Smith93 wrote: But, when what you have done, is their any of doin the process but making it show up 100 rather then 99? (Edit) -- Additional: Possible to get to count upto 100& reset to 000?
To show 000 to 100:
Add another led_7seg_quad1::ShowDigit1 macro with arguments 0, Number/100, 0.
Change Decision to: Number > 100
Carl_Smith93 wrote: I would like is possible to reset the counter on the file uploaded? If, so how?
Count is read from the position of the switch (Input icon A4->Count). Reset would mean changing the position of the switch lever. This can be done in simulation, but not in hardware (without mechanical components).
What do you want to achieve?
Yes, I changed what you did to meet what I needed and like another person said cleared the screen. Now the program is doing exactly what I wanted.

Thank you for your help & time :)

# Can be closed or whatever now

Post Reply