NXShield  v1.07
NXShield Library Reference by OpenElectrons.com
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
NXTVoltMeter.h
1 //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 // 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_VOLT_METER_H
26 #define NXT_VOLT_METER_H
27 
28 #define VM_Command 0x41
29 
30 #define ABSOLUTE_V 0X43
31 #define RELATIVE_V 0x45
32 
33 #define REFERENCE_V 0X47
34 
35 #include "NXShieldI2C.h"
38 class VoltMeter : public NXShieldI2C
39 {
40 public:
42  VoltMeter(uint8_t i2c_address = 0x26);
44  uint8_t issueCommand(char command);
47  int getAVoltage();
50  int getRVoltage();
53  int getReference();
55  int setReferenceV();
56 
57 };
58 
59 #endif
This class implements I2C interfaces used by NXShield.
Definition: NXShieldI2C.h:32
int setReferenceV()
Definition: NXTVoltMeter.cpp:53
int getReference()
Definition: NXTVoltMeter.cpp:48
int getAVoltage()
Definition: NXTVoltMeter.cpp:38
This class interfaces with sensor attached to NXShield.
Definition: NXTVoltMeter.h:38
uint8_t issueCommand(char command)
Definition: NXTVoltMeter.cpp:33
int getRVoltage()
Definition: NXTVoltMeter.cpp:43
VoltMeter(uint8_t i2c_address=0x26)
Definition: NXTVoltMeter.cpp:27