Shop OBEX P1 Docs P2 Docs Learn Events
First Boe Bot program modification problem. — Parallax Forums

First Boe Bot program modification problem.

PrettybirdPrettybird Posts: 269
edited 2009-06-15 01:00 in Robotics
· I am trying to add a section that witll enable a Parallax 5 button R/C control to be used with the roaming with ping with infrared program. The original IR sensors were changed to Sharp sensors with a compartor to a simple TTL on off signal. Works fine. Now trying to add a wireless simple 5 button board to override the roaming program when used. The R/C reciever also works fine with a simple Hi Lo output for each channel. I thought it would be simple. The boe bot book is very basic and and not much imfo on modifications I guess. Mabe you guys can steer me in the right direction. Thanks. So happy my first monster bot is finally moving. Enclosed is a copy of the program I am trying to add on to.

Comments

  • GWJaxGWJax Posts: 267
    edited 2009-06-14 23:28
    You had a few syntax errors that I corrected in your main subroutine, the DO LOOP command had a problem with missing some ENDIF commands and a GOSUB Forword_Pulse should had read GOSUB Forward_Pulse. as of running the program and testing it out I still have not finished my home brew HoboBot. but this is the code what I changed for you.

    Main:
    DO

    ' Start R/C program insert

    IF (IN1 = 1) THEN
    GOSUB Turn_Left
    ENDIF
    IF (IN2 = 1) THEN
    GOSUB Back_Up
    ENDIF
    IF (IN3 = 1) THEN
    GOSUB Turn_Right
    ENDIF
    IF (IN5 =1) THEN
    GOSUB Forward_Pulse
    ENDIF


    IF (irDetectLeft = 0) AND (irDetectRight = 0) THEN
    GOSUB Ping_Around ' Object Detected via IR Forward
    ELSEIF (irDetectLeft = 0) THEN
    GOSUB Ping_Around ' Object Detected via IR Left
    ELSEIF (irDetectRight = 0) THEN
    GOSUB Ping_Around ' Object Detected via IR Right
    ENDIF

    counter = counter + 1 ' Increment Passive Counter

    IF counter > 10 THEN ' Wait For 10 Servo Pulses
    GOSUB Ping_Out ' Activate PING)))
    ENDIF

    IF (distance > 30) THEN ' Is Object Farther Than 30 cm?
    GOSUB Forward_Pulse ' If Yes Go Forward
    ELSE
    GOSUB Ping_Around ' Otherwise Scan For Clear Path
    ENDIF

    LOOP

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
  • PrettybirdPrettybird Posts: 269
    edited 2009-06-15 01:00
    Thanks alot. This is the first time I am looking at the programming part and will get bits and peices a little at a time. I am too good at skipping pages and experimenting. Good luck with your Hobobot.
Sign In or Register to comment.