Shop OBEX P1 Docs P2 Docs Learn Events
sumbot and sonar — Parallax Forums

sumbot and sonar

sickosicko Posts: 1
edited 2007-10-05 00:51 in Robotics
I purchased the ping sonar and have attached it to my sumo bot. I ran the test program and it works. My question is how do I incorporated it into a sumobot competition program. Any example programs using the sonar. I'm really stuck here. Any help is useful.

Comments

  • D FaustD Faust Posts: 608
    edited 2007-10-05 00:51
    You could have it scan and if the value is under a certain distance then it becomes a 1, above becomes a 0.· You would end up with· something like 00000001110000.· I think there is a way of picking out the middle number but I forgot how.· Mightor was talking about doing the same thing.


    EDIT:· I found it! http://forums.parallax.com/showthread.php?p=664226

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    LOOKDOWN ThisThread, [noparse][[/noparse]Your_?, My_?, Cool_Thing], looknum
    LOOKUP looknum, [noparse][[/noparse]1, 2, 3], subnum
    ON subnum GOTO Hope_this_helps, Thanks!, WOW!!
    END 
    

    Post Edited (D Faust) : 10/5/2007 1:08:24 AM GMT
Sign In or Register to comment.