Shop OBEX P1 Docs P2 Docs Learn Events
Mysterious Reset button trick — Parallax Forums

Mysterious Reset button trick

M BushM Bush Posts: 13
edited 2006-07-24 04:55 in BASIC Stamp
I was just perusing Philip Pilgrim's outstanding document "Applying the Boe-bot Digital Encoder Kit" and I came across something that left me very puzzled.

The Wheel Odometry program on page 33 uses the reset button to decide what it is going to do when it starts.· It counts the number of times it is pressed, waits about one second, then branches to the desired location.· Here is the pertinent code:

i· VAR· Word

DATA @64, 0····· ' Initialize reset button count on upload

PAUSE 10········ ' Debounce reset button
READ 64, i······ '·Read reset button count - 1
WRITE 64, i + 1· ' Increment count and save back to EEPROM
PAUSE 1000······ ' Wait one second
WRITE 64, 0······' If not reset agiain during wait, reinitialize count
SELECT i········ ' Act based on reset button count - 1

· CASE 0:·etc
· CASE 1: etc

My question is - what is special about location 64 in EEPROM?· I looked in my handy Stamp Syntax and Reference Manual, but I couldn't find anything at all.· Is this documented somewhere else, perhaps?· What would happen if I needed to put real data into location 64?· Would the reset button overwrite it?

Scratching head....

Mike

Comments

  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2006-07-19 22:46
    Nothing special, he just selected a location.

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
  • M BushM Bush Posts: 13
    edited 2006-07-19 23:42
    AHA!! (Light bulb comes on, albeit dimly)· Any location could be used.· Thanks for the info.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-24 04:55
    Any location not used by the program or other data, yes.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.