Safe Haskell | Safe-Infered |
---|
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.
Initialization
csInit :: InputPort -> NXT ()Source
Initializes sensor on the given input port. It sets Mode
to ResultInteger
.
Measurement
csGetMeasurement :: InputPort -> NXT MeasurementSource
Gets last measurement. Based on current Mode
it return value in [0-255) (ResultByte
mode) or [0-3600) (ResultInteger
mode) range.
Configuration
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 StringSource
Reads software version string (V2.00
).
csGetVendorID :: InputPort -> NXT StringSource
Reads vendor ID string (mndsnsrs
).
csGetDeviceID :: InputPort -> NXT StringSource
Reads device ID string (CMPS
).