
Originally Posted by
Kenjones1935
I want addresses 00 and 01 to look like 4729, or preferably rounded down to 0047 or up to 0048.
This will write asci to your eeprom data. Your PicKit2 can be set to read data as asci with the little drop down box. By the way, I hope you are not writing to the eeprom each time a distance is measured, because you will wear your chip out pretty quick that way.
Code:
distance var word
inches var byte
distance = 700
distance = distance * 10
distance = distance + 74 'add half of divisor (148) , this is not needed, but will "round up" if you want to be a little more accurate
inches = distance / 148
write 0,61 'For "=" (standard asci character set)
'the + 48 changes it from dec to asci
write 1, inches dig 2 + 48 'will be a "0" if inches = 47
write 2, inches dig 1 + 48 'will be a "4" if inches = 47
write 3, inches dig 0 + 48 'will be a "7" if inches = 47
Then you can view it like this:
Bookmarks