Counting Beyond 32767

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.

Moderators: Benj, Mods

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

Counting Beyond 32767

Post by medelec35 »

Any number greater than 32767 does not show correct number on LCD display
Even if Uint (0 to 65535) or Ulong (0 to 4294967295) variables are used.

Here are two flowcharts.
One counts from 0 to 99999
the other counts from 99999 to 0

Using this method with some modifications,the maximum number can go way beyond 99999 if required.

Martin
Attachments
Count down from 99999 to 0.fcf
Created with Flowcode 5
(10 KiB) Downloaded 484 times
Count up from 0 to 99999.fcf
Created with Flowcode 5
(10 KiB) Downloaded 506 times
Martin

donald
Posts: 74
Joined: Tue Feb 14, 2012 5:17 pm
Been thanked: 3 times
Contact:

Re: Counting Beyond 32767

Post by donald »

Hi Martin,
Thank you very much sir Martin for his precious help. :D :D :D :D :D
All the best!

donald
Posts: 74
Joined: Tue Feb 14, 2012 5:17 pm
Been thanked: 3 times
Contact:

Re: Counting Beyond 32767

Post by donald »

Hi Martin,
It is interesting to memorize as if power is interrupted, it to return to counting from where it remained and not from the beginning.
Thank you in advance!

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

Re: Counting Beyond 32767

Post by medelec35 »

Try this Flowchart.
It will write to EEPROM every time seconds are updated.
Therefore seconds from 99999 to 1 are stored in EEPROM

You don't want to keep updating EEPROM with 0 since EEPROM has a writing time of 1,000,000 operations.

Martin
Attachments
Count down from 99999 to 0 + EEPROM.fcf
(13.48 KiB) Downloaded 502 times
Martin

donald
Posts: 74
Joined: Tue Feb 14, 2012 5:17 pm
Been thanked: 3 times
Contact:

Re: Counting Beyond 32767

Post by donald »

Hi Martin,
Is super what you have created and thank you very much, esteem and respect. :D :D :D :D :D

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

Re: Counting Beyond 32767

Post by medelec35 »

No problem donald,
Hope it help you out.

Martin
Martin

leoo
Flowcode V4 User
Posts: 54
Joined: Mon Jan 19, 2009 11:43 am
Has thanked: 41 times
Been thanked: 9 times
Contact:

Re: Counting Beyond 32767

Post by leoo »

Hi Martin,

I'm quite interested to see the coding of how to store bigger numbers in EEPROM. Do you have this in a version that I can view with Flowcode 4?

Thanks.
Leo

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: Counting Beyond 32767

Post by Benj »

Hi Leo,

This article should help.

http://www.matrixmultimedia.com/article.php?a=366

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Counting Beyond 32767

Post by Enamul »

Hi

Here is Martin's code in Figure format...you can make that in FCv4.
Attachments
EEPROM_LARGE_NO.zip
(512.63 KiB) Downloaded 412 times
Enamul
University of Nottingham
enamul4mm@gmail.com

Post Reply