Shop OBEX P1 Docs P2 Docs Learn Events
retrieving info from memory — Parallax Forums

retrieving info from memory

kingbpkingbp Posts: 22
edited 2012-04-19 21:42 in Robotics
Hello i have a code for the boe-bot where its navigating through a maze and storing the paths as it goes im trying to store the paths as the go and retrieve the path later on. Im using the write command to write the paths as its going to memory but im having trouble reading or retrieving the paths from memory. I made the boe-bot write R in memory for every right turn taking but im telling it to retrieve R from memory but the boe-bot doesnt know that R represents a right turn how can i make the boebot realize when it reads R from memory that R is the Case for right turn

CASE %0111
GOSUB RIGHTTURN

eepromAddress var byte



If sensor = %0111 THEN
Write eepromAddress, "R"
ENDIF

Read "R", eepromAddress

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-04-19 21:42
    First of all, you should read the documentation on the READ statement. You read the content of an EEPROM location into a variable, then you use an IF statement or a SELECT statement to test that variable's value to see if it's an "R" or something else.

    There's a very good tutorial on Stamp programming called "What's a Microcontroller?". Maybe you should go through that. Like the Stamp Manual, you can download it or look in the Stamp Editor's help files for it.

    From your postings, you don't seem have code yet that will compile, let alone run. It's poor form to post code that won't even compile.

    attachment.php?attachmentid=78421&d=1297987572
Sign In or Register to comment.