Shop OBEX P1 Docs P2 Docs Learn Events
Ping))) and BOE-BOT — Parallax Forums

Ping))) and BOE-BOT

jeffrey morrisjeffrey morris Posts: 52
edited 2013-02-10 18:17 in Robotics
I got a package from Parallax containing Ping))) sensor, Pololu motor controller, and a standard servo. After running the ping-demo program and finding out that it worked, how can I write a PBASIC program that causes the BOE-BOT to back up and turn when Ping))) sensor finds objects that blocks the BOE-BOT?

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-09-12 23:30
    jeffrey,

    ·· You would need to combine the code for both devices so that the PING code affects the operation of the motor controller.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • jeffrey morrisjeffrey morris Posts: 52
    edited 2005-09-13 00:32
    Let's say that the program for the Ping))) sensor finds out that the BOE-BOT is five inches from a wall, the program backs up the robot for a second. I want the program to randomly turn the robot left or right. I looked up the RANDOM command in PBASIC online help but how does the program generate a random number of 0 or 1 for the ON GOSUB command?
  • CJCJ Posts: 470
    edited 2005-09-13 00:44
    just RANDOM a bit variable like this before the ON GOSUB

    RANDOM bitvar

    just make sure that the variable is declared before using
  • jeffrey morrisjeffrey morris Posts: 52
    edited 2005-09-13 14:54
    I took some code from the random.bs2 program and combined it with my code for the robot program.
  • BattleToadsBattleToads Posts: 2
    edited 2013-02-10 15:54
    jeffrey,

    ·· You would need to combine the code for both devices so that the PING code affects the operation of the motor controller.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com

    Buenas yan Hafa Adai Mr. Savage, the whole ping commands are pretty confusing. In detail can you tell me about what exactly pings are supposed to do.

    shoot par
  • NWCCTVNWCCTV Posts: 3,629
    edited 2013-02-10 18:17
    can you tell me about what exactly pings are supposed to do.

    Think of it as a Sonar in a Submarine. The Ping sends out a signal. When that signal hits something in its path it "bounces" back to the Ping giving you the reading.
Sign In or Register to comment.