| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Robotics.NXT.Sensor.Compass
Description
This module defines an interface to CMPS-Nx digital compass sensor from http://www.mindsensors.com/ according to
CMPS-Nx-V20-User-Guide.pdf documentation.
- csInit :: InputPort -> NXT ()
- csGetMeasurement :: InputPort -> NXT Measurement
- csSetMode :: InputPort -> Mode -> NXT ()
- data Mode
- csGetVersion :: InputPort -> NXT String
- csGetVendorID :: InputPort -> NXT String
- csGetDeviceID :: InputPort -> NXT String
Initialization
csInit :: InputPort -> NXT () Source
Initializes sensor on the given input port. It sets Mode to ResultInteger.
Measurement
csGetMeasurement :: InputPort -> NXT Measurement Source
Gets last measurement. Based on current Mode it return value in [0-255) (ResultByte mode) or [0-3600) (ResultInteger mode) range.
Configuration
Constructors
| AutoTrigOn | AutoTrig (continuous measuring) on. |
| AutoTrigOff | AutoTrig (continuous measuring) off. |
| ResultByte | Result is a byte mapped to [0-255). |
| ResultInteger | Result is an integer mapped to [0-3600). |
| Frequency50 | Sampling frequency 50 Hz (Europe standard). |
| Frequency60 | Sampling frequency 60 Hz (USA standard). |
| BeginCalibration | Begin calibration mode. |
| EndCalibration | End calibration mode. |
Constants
csGetVersion :: InputPort -> NXT String Source
Reads software version string (V2.00).
csGetVendorID :: InputPort -> NXT String Source
Reads vendor ID string (mndsnsrs).
csGetDeviceID :: InputPort -> NXT String Source
Reads device ID string (CMPS).