|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#6
|
||||
|
||||
|
Re: Ultrasonic rangefinder code
We aren't using EasyC or WPILIB, but we have used the Maxbotic sensor using analog with good results. The current models use a 9.8mV to an inch scaling.
The code was simple as well. Here's a sample for it that I just typed from memory using analog port 1: Code:
unsigned int sonic; unsigned int mV; unsigned int inches; sonic = Get_Analog_Value(rc_ana_01); mV =( (sonic * 5000) / 1024 ); inches = mV * 10 / 98; Last edited by Phalanx : 23-01-2008 at 21:24. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SRF04 Ultrasonic Rangefinder Unresponsive | the401tauntaun | Programming | 10 | 20-01-2008 12:39 |
| Ultrasonic will not work with another Ultrasonic plz help | Jackel148 | Programming | 10 | 10-05-2006 15:31 |
| Ultrasonic Distances | irishninja | FIRST Tech Challenge | 1 | 30-04-2006 20:25 |
| Programming Parallax Ultrasonic Rangefinder | edman | Programming | 2 | 17-02-2006 08:35 |
| Ultrasonic Rangefinder Operating On I2C Bus | CapnBFG | Electrical | 10 | 04-06-2005 01:31 |