Class HiTechnicCompass

  extended by edu.wpi.first.wpilibj.SensorBase
      extended by edu.wpi.first.wpilibj.HiTechnicCompass
All Implemented Interfaces:
IDevice, ISensor, FrcBotSimComponent

public class HiTechnicCompass
extends SensorBase
implements ISensor

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:

Nested Class Summary
 class HiTechnicCompass.CompassException
          An exception dealing with connecting to and communicating with the HiTechnicCompass
Field Summary
Fields inherited from class edu.wpi.first.wpilibj.SensorBase
kAnalogChannels, kAnalogModules, kDigitalChannels, kPwmChannels, kRelayChannels, kSolenoidChannels, kSolenoidModules, kSystemClockTicksPerMicrosecond, n_simProperties
Constructor Summary
HiTechnicCompass(int slot)
Method Summary
 void free()
 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, getSimProperties, setDefaultAnalogModule, setDefaultDigitalModule, setDefaultSolenoidModule
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public HiTechnicCompass(int slot)

slot - The slot of the digital module that the sensor is plugged into.
Method Detail


public void free()

free in class SensorBase


public double getAngle()
Get the compass angle in degrees. The resolution of this reading is 1 degree.

Angle of the compass in degrees.