edu.wpi.first.wpilibj
Class HiTechnicCompass
java.lang.Object
edu.wpi.first.wpilibj.SensorBase
edu.wpi.first.wpilibj.HiTechnicCompass
public class HiTechnicCompass
- extends SensorBase
HiTechnic NXT Compass.
This class alows access to a HiTechnic NXT Compass on an I2C bus.
These sensors to not allow changing addresses so you cannot have more
than one on a single bus.
Details on the sensor can be found here:
http://www.hitechnic.com/index.html?lang=en-us&target=d17.html
Method Summary |
protected void |
free()
Destructor. |
double |
getAngle()
Get the compass angle in degrees. |
Methods inherited from class edu.wpi.first.wpilibj.SensorBase |
checkAnalogChannel, checkAnalogModule, checkDigitalChannel, checkDigitalModule, checkPWMChannel, checkPWMModule, checkRelayChannel, checkRelayModule, checkSolenoidChannel, checkSolenoidModule, getDefaultAnalogModule, getDefaultDigitalModule, getDefaultSolenoidModule, setDefaultAnalogModule, setDefaultDigitalModule, setDefaultSolenoidModule |
HiTechnicCompass
public HiTechnicCompass(int slot)
- Constructor.
- Parameters:
slot
- The slot of the digital module that the sensor is plugged into.
free
protected void free()
- Destructor.
- Overrides:
free
in class SensorBase
getAngle
public double getAngle()
- Get the compass angle in degrees.
The resolution of this reading is 1 degree.
- Returns:
- Angle of the compass in degrees.
Copyright © 2006-2009 Sun Microsystems, Inc. All Rights Reserved.