NXShield  v1.07
NXShield Library Reference by OpenElectrons.com
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
AngleSensor.h
1 
2 // AngleSensor.h
3 //
4 // This is a class for reading from AngelSensor, made by Mindsensors.
5 // See http://www.mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=173
6 
7 // Initial version: 2012-09-17 by Deepak Patil
8 
9 /*
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Lesser General Public
12  License as published by the Free Software Foundation; either
13  version 2.1 of the License, or (at your option) any later version.
14 
15  This library is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public
21  License along with this library; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 */
24 
25 
26 #ifndef ANGLE_SENSOR_H
27 #define ANGLE_SENSOR_H
28 
29 #define AS_Command 0x41
30 
31 #define ANGLE 0x42
32 #define RAW_READING 0x46
33 
34 #include "NXShieldI2C.h"
35 
40 class AngleSensor : public NXShieldI2C
41 {
42 public:
44  AngleSensor(uint8_t i2c_address = 0x30);
45 
47  uint8_t issueCommand(char command);
48 
51  long getAngle();
52 
55  long getRawReading();
56 
59  void reset();
60 
61 };
62 
63 #endif
This class implements I2C interfaces used by NXShield.
Definition: NXShieldI2C.h:32
This class interfaces with sensor attached to NXShield.
Definition: AngleSensor.h:40
AngleSensor(uint8_t i2c_address=0x30)
Definition: AngleSensor.cpp:28
long getAngle()
Definition: AngleSensor.cpp:35
uint8_t issueCommand(char command)
long getRawReading()
Definition: AngleSensor.cpp:40
void reset()
Definition: AngleSensor.cpp:46