A byte is 256 steps starting at 0.
Not knowing the value of "boardadd" I will make a guess and say changing it to WORD is all you have to do. Pulling the three digits of boardadd, 999 would be the largest number... right?
A byte is 256 steps starting at 0.
Not knowing the value of "boardadd" I will make a guess and say changing it to WORD is all you have to do. Pulling the three digits of boardadd, 999 would be the largest number... right?
Dave
Always wear safety glasses while programming.
thanks mackrackit. the BoardAdd is stored in EEPROM 0, with a min value of 001 to a max value of 254. I hope that answers what your trying to ask me?
Thanks,
C
Dave
Always wear safety glasses while programming.
Sorry, I guess I should have noted that this routine checks to make sure you don't try to write an address to EEPROM that is >254 or is =0. So, if a user enters "A280" for example, I want that to be invalid. I hope that helps explain my goal?
Just tried it in the sim...
I entered "A300" and it returned with,
"Board received A044
Board address set to 44"
Hopefully you can see what I mean?
Thanks again,
C
Ok... Go ahead and change it to a WORD. 44 is what you are getting when it rolls over.
Dave
Always wear safety glasses while programming.
On that note, a word sized var won't flow over into EEPROM 1 will it? I'de like to avoid that if I could.
Thanks again,
C
It should not. Your code is making the max 254. The WORD size just lets something bigger, like 300 be seen as 300.
Dave
Always wear safety glasses while programming.
Bookmarks