Shop OBEX P1 Docs P2 Docs Learn Events
SRF08 to take distance readings and determines to make the Boe-Bot go left, rig — Parallax Forums

SRF08 to take distance readings and determines to make the Boe-Bot go left, rig

Martin NelisseMartin Nelisse Posts: 2
edited 2005-11-27 19:23 in Robotics
I would like·to use my SRF08 to take distance readings and·determines to make the Boe-Bot go left,·right or turn. I compared different codes·hoping to·try make one for my Boe-Bot by·reading·the N&V column Robot eyes, the SRF08 demo code, the SRF04 sonic sight code and the S3 SRF04 Distance Decision code from Crustcrawler. But it seem i cant make cheese of it. For instance the SRF04 uses Get_Distance and RawDist

GOSUB Get_Distance
··· IF (rawDist < TooClose) THEN
··· Backup

But how does this work for the SRF08?

The·demo SRF08 demo code works fine and have no problems with connections or what so ever.

I`m a newbe and just finished the Robotis with the Boe-Bot book so i hope some can help me out with a code or something.

Greetings.

Martin

The Netherlands.

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-11-27 19:23
    If you've got working demo code for the SRF08 you should be able to lift the distance measurement subroutine from it, then use the output value in your comparision. Remember that the SRF08 is addressable, and that will be useful in your robot if you have more than one sensor. Just make sure your code knows which sensor it's using and is doing the appropriate comparison.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.