View Single Post
  #9   Spotlight this post!  
Unread 24-01-2008, 21:07
Phalanx's Avatar
Phalanx Phalanx is offline
Formerly Team 1089 (Mercury)
AKA: Michael Reffler
FRC #5431 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jun 2005
Rookie Year: 1999
Location: Lewisville, TX (previously NJ)
Posts: 384
Phalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond repute
Re: Ultrasonic rangefinder code

Quote:
Originally Posted by Andy Goetz View Post
If you do the algebra, with the Maxsonar, you can just divide the incoming value by two to get the distance in inches.
Well you can do that, if you don't mind the small error that is introduced from it, and that the version of the sensor uses 10mV per inch scaling. All the newer models use 9.8mV per inch scaling so your range readings will be off even more.

For example a reading of 512 would be 2.5mV which is very close the 2.55mV maximum range that this device uses. So dividing by 2 would give you 256, which is close to 250 inches the device is reporting, but 6 inches off at that range(using 10mV inch). As you get closer it becomes less of an issue.

It all depends on the level of precision you need or want.
__________________
Don't just ask the experts, become one!
Leadership is not about ability. It's about responsibility!
Diagonally Parked in a Parallel Universe. It's okay we do Quantum Physics