com.ridgesoft.robotics.sensors
Class DevantechCMPS03
java.lang.Object
com.ridgesoft.robotics.Compass
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. |
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
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
Copyright (c) 2003-2009 RidgeSoft, LLC. All rights reserved.
www.ridgesoft.com