CMPS03 digital compass library.
Dependents: CMPS03_HelloWorld Final_Sonar xbeetx Compass ... more
CMPS03 Class Reference
CMPS03 digital compass module. More...
#include <CMPS03.h>
Public Member Functions | |
CMPS03 (PinName sda, PinName scl, int address) | |
Constructor. | |
char | readSoftwareRevision (void) |
Reads the software revision register [register 0] on the device. | |
int | readBearing (void) |
Reads the current bearing of the compass. |
Detailed Description
CMPS03 digital compass module.
Definition at line 57 of file CMPS03.h.
Constructor & Destructor Documentation
CMPS03 | ( | PinName | sda, |
PinName | scl, | ||
int | address | ||
) |
Constructor.
Includes.
- Parameters:
-
sda mbed pin to use for I2C SDA scl mbed pin to use for I2C SCL address I2C address of this device.
LICENSE
Copyright (c) 2010 ARM Limited
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
DESCRIPTION
CMPS03 digital compass module.
Datasheet:
http://www.robot-electronics.co.uk/htm/cmps3tech.htm
Definition at line 40 of file CMPS03.cpp.
Member Function Documentation
int readBearing | ( | void | ) |
Reads the current bearing of the compass.
- Returns:
- The current bearing of the compass as a value between 0 and 3599, representing 0 - 359.9 degrees.
Definition at line 65 of file CMPS03.cpp.
char readSoftwareRevision | ( | void | ) |
Reads the software revision register [register 0] on the device.
- Returns:
- The contents of the software revision register as a byte.
Definition at line 49 of file CMPS03.cpp.
Generated on Tue Jul 12 2022 11:37:22 by 1.7.2