For a mobile robot, the measurement of distance is an important piece of information needed for it to help determine where it is in the world. It is also very important to keep it from running into things. Gamma can now measure the distance in front of it to the nearest object. It does this using the Ping))) sensors mounted on the front of it. Since Gamma uses the Propeller as its processor the code for the ping can be found in the OBEX. This takes the complexities of converting microseconds between pulses to lines as simple as "range := ping.Inches(PING_CENTER)" where "range" is the variable for storing the distance, and "PING_CENTER" is the IO pin that the ping is connected to. Click "Read More" to see (and download) a sample program that reads the distances from 3 pings and displays them on the terminal. Note: this requires use of the Parallax Serial Terminal library.
Leave a Reply.
This blog covers a multitude of up and coming technology, as well as how to guides, tips and tricks, and other interesting technology related items.