Shop OBEX P1 Docs P2 Docs Learn Events
need help with gripper for school project — Parallax Forums

need help with gripper for school project

jturovskiyjturovskiy Posts: 1
edited 2010-05-19 20:29 in BASIC Stamp
I'm working on a BOE-BOT with the Gripper attachment for a competition in my school. We got the movement of the bot down, and the gripper function to work, but not together. Yesterday, I managed to get both actions to work together, but I had to get rid of the HALT command in order to get the gripper to work. I don't know much about this, so any help would be greatly appreciated!

Here's a copy of my code so far if it'll help.

Comments

  • metron9metron9 Posts: 1,100
    edited 2010-05-19 20:29
    You are using GOSUB for KEYX and KEYO and then using a GOTO back to the top of the loop.

    Use RETURN for GOSUB instead of GOTO

    Reason:

    Gosub puts the address of the next command on a stack )like a stack of plates) Then the return pops the address back off the stack when the RETURN command is issued. This then continues program execution to the next command in line after the GOSUB command. Without using RETURN you are overflowing the stack (the stack can hold a finite number of return addresses) so you crash the program by running out of memory.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
Sign In or Register to comment.