EVShield  v1.3
EVShield Library Reference by mindsensors.com
EVs_NXTVoltMeter.h
1 //EVs_NXTVoltMeter.h
2 //
3 // This is a class for reading from NXTVoltMeter, made by Mindsensors.
4 // See http://www.mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=162
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_NXTVoltMeter_H
27 #define EVs_NXTVoltMeter_H
28 
29 #define VM_Command 0x41
30 
31 #define ABSOLUTE_V 0X43
32 #define RELATIVE_V 0x45
33 
34 #define REFERENCE_V 0X47
35 
36 #include "EVShieldI2C.h"
39 class EVs_VoltMeter : public EVShieldI2C
40 {
41 public:
43  EVs_VoltMeter(uint8_t i2c_address = 0x26);
45  uint8_t issueCommand(char command);
48  int getAVoltage();
51  int getRVoltage();
54  int getReference();
56  int setReferenceV();
57 
58 };
59 
60 #endif
int getRVoltage()
Definition: EVs_NXTVoltMeter.cpp:44
This class interfaces with sensor attached to EVShield.
Definition: EVs_NXTVoltMeter.h:39
uint8_t issueCommand(char command)
Definition: EVs_NXTVoltMeter.cpp:34
int getReference()
Definition: EVs_NXTVoltMeter.cpp:49
EVs_VoltMeter(uint8_t i2c_address=0x26)
Definition: EVs_NXTVoltMeter.cpp:28
int setReferenceV()
Definition: EVs_NXTVoltMeter.cpp:54
int getAVoltage()
Definition: EVs_NXTVoltMeter.cpp:39
This class implements I2C interfaces used by EVShield.
Definition: EVShieldI2C.h:32