View Single Post
  #3   Spotlight this post!  
Unread 25-11-2012, 01:21
Skyehawk's Avatar
Skyehawk Skyehawk is online now
Nuts N' Bolts
AKA: Skye Leake
FRC #0876 (Thunder Robotics)
Team Role: Mentor
 
Join Date: Nov 2012
Rookie Year: 2011
Location: Northwood, ND
Posts: 240
Skyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to all
Re: Programming for sonar with MaxRobotix Sensor

Quote:
Originally Posted by thephpdev View Post
You can get a reading from a sensor by getting the voltage output by the sensor. Which can be done like this:
Code:
private AnalogChannel ultrasonic = new AnalogChannel(1);
private double voltage = ultrasonic.getVoltage();
To get inches from the sensor I THINK you need to multiply the output voltage by 100. again I'm not positive. This is info I carried over from Labview. I see no reason it would be different.
Reply With Quote