convert a string of 7 ascii characters in a word

General discussion on mikroBasic PRO for PIC.
Post Reply
Author
Message
igeorge
Posts: 593
Joined: 28 Dec 2005 09:15

convert a string of 7 ascii characters in a word

#1 Post by igeorge » 17 Jul 2021 18:55

Hello,
I am using the keypad 4x4 (attached) from mikroe.
I managed to change and display each key on the row 3 one after other.
I display 7 key and then counter start to zero and i overwrite the key i display before.
Each time after key 7, i start from position one.
What i want to do is to convert this row of 7 numbers in a word.
The most left number (the first one in the row) will be the most significative number.
For example if i have on display
1234567 this should be converted as 1.234.567 number, starting to one million 2 hundreds , thirty four thousands and so on.
Of course this it is a decimal number which in hex will be 00 12 D6 87 - one word.
This is what I want to achieve, so i can store it on the EEprom.
Please help me if you can.
Thank you very much.
Keypad_4x4.zip
(20.11 KiB) Downloaded 36 times
Experience is something you don't get until just after you need it

zan
Posts: 434
Joined: 15 May 2007 19:35

Re: convert a string of 7 ascii characters in a word

#2 Post by zan » 19 Jul 2021 19:49

Hi,

why don't you save all seven bytes to eeprom?
It would be much simpler than converting large numbers.

igeorge
Posts: 593
Joined: 28 Dec 2005 09:15

Re: convert a string of 7 ascii characters in a word

#3 Post by igeorge » 19 Jul 2021 19:57

Thank you Zan.
It did not passed through my mind to do that.
I will try.
What i want to achieve is to record a master code to eeprom when the user press the keys, and later read from eeprom and compare with the user entry.
I will try your suggestion.
Thank you.
Experience is something you don't get until just after you need it

Post Reply

Return to “mikroBasic PRO for PIC General”