Shop OBEX P1 Docs P2 Docs Learn Events
ping))) and servos — Parallax Forums

ping))) and servos

BOB55BOB55 Posts: 36
edited 2008-04-13 16:05 in BASIC Stamp
Hi
Im trying to make a parallax continuous servo work with a Ping))) sensor, but I can't find or create a code that would make them work with each other. EX. If there's an object in front of the Ping))) sensor I want the servo to go on reverse. Can someone please give me a code that i would be able to use?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-03-19 13:45
    Where have you looked for information and what have you tried already? There's plenty of information and sample programs of pieces of what you want, but no "ready to go" programs. Start with several "Stamps in Class" tutorials (www.parallax.com/tabid/535/Default.aspx), in particular "Robotics with the BoeBot" which covers the use of servos and "What's a Microcontroller?" which is an introduction. There are some good sample programs for the PING and the PING documentation itself (www.parallax.com/Store/Sensors/ObjectDetection/tabid/176/CategoryID/51/List/0/Level/a/ProductID/92/Default.aspx?SortField=ProductName%2cProductName).
  • BOB55BOB55 Posts: 36
    edited 2008-04-12 23:36
    Thanks Mike Green for the info. it really helped.
    Now that I have the program, how would i change the distance of the ping from looking at only 30cm to actually seeing about 3 meters?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    BOB55
  • Chris CChris C Posts: 50
    edited 2008-04-13 16:05
    Make sure you have the conversion for the PING's reading into cm like in the sample program, then simply use case statements or loops to perform whatever function you want when it is within Xcm. I wrote my program to send the reading serially out if the reading is between 2 and 22 inches and it works right.
Sign In or Register to comment.