Shop OBEX P1 Docs P2 Docs Learn Events
boebot — Parallax Forums

boebot

antoniantoni Posts: 2
edited 2008-03-19 14:18 in Robotics
how can i control a boebot from computer if the robot has no interrupts?. The robot must move and in the same time he must get the commands from the computer. The robot is equipped with bs2. thanks for help

Comments

  • Steve JoblinSteve Joblin Posts: 784
    edited 2008-03-19 13:04
    A BS2 is a single threaded processor, so it can only do one thing at a time. You might want to consider a co-proessor to control the motors. This will free your BS2 up from constantly managing the motors and will have time to spend "listening" for instructions from your computer. Remember that the BOEbot uses modified servos that don't need "constant" attention... there is about a 20ms period of time where you can do other things before you need to pulse the servos again.
  • antoniantoni Posts: 2
    edited 2008-03-19 13:55
    how will know the bot when a key(from the computer keyboard) is pressed? there is other solution other then read from time to time the port connected to the computer? doing so it assume that the computer will send data all the time(to know if a key is pressed or not). thanks
  • Mike GreenMike Green Posts: 23,101
    edited 2008-03-19 14:18
    The best way to do this is to make the BoeBot the "master". By this I mean that the BoeBot sends a request to the PC (like the character"?") for the current key status. Whenever the PC sees the request character, it sends back the current key code information or a value (not on the keyboard) that says that no key is available. The BoeBot only requests information when it has a moment to wait for a reply.

    As Steve mentioned, it's a good idea to use a co-processor to take over the task of sending control pulses to the servos in this situation. The ServoPAL is ideal for this. This way, the Stamp doesn't have to worry about missing the 20ms limit for the servo pulses. (The servo will turn itself off if it doesn't get a control pulse roughly every 20ms).

    Another option is to use a serial input buffer like those from Protean-Logic (www.proteanlogic.com/product_periph_rs232.shtml). This can receive and hold up to 32 characters from the PC which the Stamp can access when it has time.
Sign In or Register to comment.