NXShield  v1.07
NXShield Library Reference by OpenElectrons.com
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
NXTCurrentMeter.h
1 //NXTCurrentMeter.h
2 //
3 // This is a class for reading from NXTCurrentMeter, made by Mindsensors.
4 // See http://www.mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=163
5 
6 // Initial version: 2013-01-24 by Michael Giles
7 // Large parts of the code is ported from the NXC library for the device,
8 // written by Deepak Patil.
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 #ifndef NXT_CURRENT_METER_H
26 #define NXT_CURRENT_METER_H
27 
28 #define IM_Command 0x41
29 
30 #define ABSOLUTE_I 0X43
31 #define RELATIVE_I 0x45
32 
33 #define REFERENCE_I 0X47
34 
35 #include "NXShieldI2C.h"
38 class CurrentMeter : public NXShieldI2C
39 {
40 public:
42  CurrentMeter(uint8_t i2c_address = 0x28);
44  uint8_t issueCommand(char command);
47  int getACurrent();
50  int getRCurrent();
53  int getReference();
55  int setReferenceI();
56 
57 };
58 
59 #endif
This class implements I2C interfaces used by NXShield.
Definition: NXShieldI2C.h:32
int getReference()
Definition: NXTCurrentMeter.cpp:48
int getRCurrent()
Definition: NXTCurrentMeter.cpp:43
int getACurrent()
Definition: NXTCurrentMeter.cpp:38
uint8_t issueCommand(char command)
Definition: NXTCurrentMeter.cpp:33
CurrentMeter(uint8_t i2c_address=0x28)
Definition: NXTCurrentMeter.cpp:27
int setReferenceI()
Definition: NXTCurrentMeter.cpp:53
This class interfaces with sensor attached to NXShield.
Definition: NXTCurrentMeter.h:38