Shop OBEX P1 Docs P2 Docs Learn Events
Stop My robot — Parallax Forums

Stop My robot

SYSSSYSS Posts: 10
edited 2010-03-09 19:16 in Learn with BlocklyProp
I have designed my wireless robot with IR sensors and everything is fine, but the problem is that
IR sensor detect any object it freeze and donot show any action even if I try to make it to move in other directions. How can i solve this problem?
I can not make it move to other directions automatically from it self, I have to control everything ?
any suggestions?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-03-09 16:03
    1) You have to provide more information. Specifically, you have to attach a copy of your source code using the Attachment Manager that you get by using the Post Reply button. Don't use the Quick Reply box for this. In addition, you need to provide a description of your IR sensors and how they (and other things) are connected so we can try to make sense of your code.

    2) It is the nature of programming and microcontrollers that very little is done automatically for you. Usually you do have to control almost everything.
  • SYSSSYSS Posts: 10
    edited 2010-03-09 18:36
    all files are attached you can check it
    213 x 199 - 5K
    931 x 652 - 60K
    2048 x 1536 - 484K
  • Mike GreenMike Green Posts: 23,101
    edited 2010-03-09 19:16
    1) I don't understand why you have RETURN statements when those parts of the code are not subroutines called with GOSUB. The RETURNs will cause the Stamp to reset (and start the program over again from the beginning). Read the BASIC Stamp Syntax and Reference Manual chapters on the GOSUB and RETURN statements.

    2) Your PULSOUT loops don't have a PAUSE in them. Servo motors require a short (1-2ms) pulse about 50 times a second. The pulse width specifies the position (for standard servos) or direction and speed (for continuous motion servos). If you send too many pulses, the servo might get confused or at least ignore some of them. If you don't send enough pulses, the servo will turn itself off until the next pulse comes in which will make the servo twitch. The Robotics with the BoeBot tutorial goes into this in detail.

    Both manuals/tutorials are downloadable from Parallax. Use the Downloads button on their website and use the BASIC Stamp Documentation and the Stamps in Class Downloads links.
Sign In or Register to comment.