RoboJDETM v2.0

com.ridgesoft.robotics.sensors
Class DevantechCMPS03

java.lang.Object
  extended by com.ridgesoft.robotics.Compass
      extended by com.ridgesoft.robotics.sensors.DevantechCMPS03

public class DevantechCMPS03
extends Compass

Class to interface with a Devantech CMPS03 magnetic compass attached to a pulse input.


Constructor Summary
DevantechCMPS03(PulseInput compassInput)
          Constructs a Compass object for a CMPS03 compass attached to a pulse input port.
 
Method Summary
 int heading()
          Reads the current heading from the compass.
 
Methods inherited from class com.ridgesoft.robotics.Compass
direction, direction, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait
 

Constructor Detail

DevantechCMPS03

public DevantechCMPS03(PulseInput compassInput)
Constructs a Compass object for a CMPS03 compass attached to a pulse input port.

Parameters:
compassInput - PulseInput port the compass is attached to
Method Detail

heading

public int heading()
Reads the current heading from the compass.

The CMPS03 sends an update pulse every 66-102 milliseconds. Reading the compass too frequently will result in -1 being returned.

Specified by:
heading in class Compass
Returns:
heading in degrees (0 - 359) or -1 if compass is not providing valid data

RoboJDETM v2.0

Copyright (c) 2003-2009 RidgeSoft, LLC. All rights reserved.
www.ridgesoft.com