For anyone interested in using a
SONAR sensor I have completed a software driver for it. If anyone has any questions feel free to post in this thread.
Once I develop a personal website I will post the software there. Until that time it can be found by using the link in this thread.
SONAR_0.1.zip
The introduction from the readme:
Code:
Introduction:
This source code in sonar.c and sonar.h are a driver for several consumer
available sonar ultrasonic range finder sensors. Tested to work with this
software is the Parallax Inc. PING)) Ultrasonic Rangefinder and the Vex
Robotics Ultrasonic Range Finder.
This software was written for the Innovation First Inc. Mini Robot Controller.
Unmodified this software utilizes Interrupt 1 and Timer 3. Other controllers
may be used including Innovation First Inc.'s full size robot controller as
well as other PIC microcontrollers with modifications. The documentation refers
to the controlling microcontroller simply as the controller.
This software works by triggering the sonar sensor causing it to send an
acoustic ping. Once the ping hits an object it will reflect back towards the
sensor. The sonar sensor represents the distance to the object with a pulse
width equal to the time it took for the ping to hit the object and return back.
This software measures the pulse width and converts the time to a distance in
inches.