EVShield  v1.3
EVShield Library Reference by mindsensors.com
EVs_NXTCurrentMeter.h
1 //EVs_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 // Modified for EVShield: 2015-2-16 by Michael Giles
8 // Large parts of the code is ported from the NXC library for the device,
9 // written by Deepak Patil.
10 /*
11  This library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU Lesser General Public
13  License as published by the Free Software Foundation; either
14  version 2.1 of the License, or (at your option) any later version.
15 
16  This library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  Lesser General Public License for more details.
20 
21  You should have received a copy of the GNU Lesser General Public
22  License along with this library; if not, write to the Free Software
23  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 */
25 
26 #ifndef EVs_NXTCurrentMeter_H
27 #define EVs_NXTCurrentMeter_H
28 
29 #define IM_Command 0x41
30 
31 #define ABSOLUTE_I 0X43
32 #define RELATIVE_I 0x45
33 
34 #define REFERENCE_I 0X47
35 
36 #include "EVShieldI2C.h"
40 {
41 public:
43  EVs_CurrentMeter(uint8_t i2c_address = 0x28);
45  uint8_t issueCommand(char command);
48  int getACurrent();
51  int getRCurrent();
54  int getReference();
56  int setReferenceI();
57 
58 };
59 
60 #endif
EVs_CurrentMeter(uint8_t i2c_address=0x28)
Definition: EVs_NXTCurrentMeter.cpp:28
int getReference()
Definition: EVs_NXTCurrentMeter.cpp:49
int getACurrent()
Definition: EVs_NXTCurrentMeter.cpp:39
This class interfaces with sensor attached to EVShield.
Definition: EVs_NXTCurrentMeter.h:39
This class implements I2C interfaces used by EVShield.
Definition: EVShieldI2C.h:32
uint8_t issueCommand(char command)
Definition: EVs_NXTCurrentMeter.cpp:34
int getRCurrent()
Definition: EVs_NXTCurrentMeter.cpp:44
int setReferenceI()
Definition: EVs_NXTCurrentMeter.cpp:54