loading
 
Ping Ultrasonic Sensor / Arduino / Serial
spacehermit from United States  [28 posts]
13 year
I'm trying to get the Ping Ultrasonic Sensor by Parallax to work with my Arduino Uno and Roborealm but I can't figure out how to receive the distance from the object as a variable...  I figure that I may end up having to use the Serial Module but don't know enough Arduino Sketch coding. (Nor Serial Module coding.)  Though I am looking into it and will gladly post the results here, but I was also hoping someone might have done it before me and could lend me a hand.  The other issue is that I would like to use the Arduino Uno as a Servo Controller and for more than one Ultrasonic Sensor, not to mention the digital compass and encoder reader... so yeah, I have some work cut out for me.  Any code samples or friendly tutorials would be greatly appreciated.
Thanks
-spacehermit
fred miller from United States  [72 posts] 13 year
also want to use SR04 sonar with UNO board,i know sketch pad needs to be changed
STEVEN any ideas how to do it,not want to change the wrong code so it wont work in roborealm
what codes do i dont touch and how do i add my new codes
Anonymous 13 year
Have a look at the MCU Communicator module and the provided example sketch code. There are a couple of examples in that code of how to send and receive values within the Arduino to the PC running RR. You will have to extend the code but that's much easier than starting from scratch with the serial module.

Try out the example as is first before making modifications. Post here if you get stuck on a particular piece of code.

STeven.
fred miller from United States  [72 posts] 13 year
oh,didnt see that ,will look at the sketch code,thanks Steven
spacehermit from United States  [28 posts] 13 year
Here is an Arduino Uno Sketch I made to interface with Roborealm's Serial Module.  It handles 4 Ping Ultrasonic Sensors, and 4 Servos.

enjoy
ArduinoSketchforRoboRealmServosAndPing.zip

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index