2
2
//
3
3
// FILE: ADS1X15.h
4
4
// AUTHOR: Rob Tillaart
5
- // VERSION: 0.4.1
5
+ // VERSION: 0.4.2
6
6
// DATE: 2013-03-24
7
7
// PURPOSE: Arduino library for ADS1015 and ADS1115
8
8
// URL: https://github.com/RobTillaart/ADS1X15
12
12
#include " Arduino.h"
13
13
#include " Wire.h"
14
14
15
- #define ADS1X15_LIB_VERSION (F(" 0.4.1 " ))
15
+ #define ADS1X15_LIB_VERSION (F(" 0.4.2 " ))
16
16
17
17
// allow compile time default address
18
18
// address in { 0x48, 0x49, 0x4A, 0x4B }, no test...
@@ -72,8 +72,8 @@ class ADS1X15
72
72
int16_t readADC_Differential_0_1 ();
73
73
74
74
// used by continuous mode and async mode.
75
- [[deprecated(" Use getValue() instead" )]]
76
- int16_t getLastValue () { return getValue (); }; // will be obsolete in the future 0.4.0
75
+ // [[deprecated("Use getValue() instead")]]
76
+ // int16_t getLastValue() { return getValue(); }; // will be obsolete in the future 0.4.0
77
77
int16_t getValue ();
78
78
79
79
@@ -86,7 +86,7 @@ class ADS1X15
86
86
bool isReady ();
87
87
88
88
89
- // returns a pin 0x0[0..3] or
89
+ // returns a pin 0x0[0..3] or
90
90
// a differential "mode" 0x[pin second][pin first] or
91
91
// 0xFF (no request / invalid request)
92
92
uint8_t lastRequest ();
@@ -164,7 +164,7 @@ class ADS1X15
164
164
uint8_t _compLatch;
165
165
uint8_t _compQueConvert;
166
166
167
- // variable to track the last pin requested,
167
+ // variable to track the last pin requested,
168
168
// to allow for round robin query of
169
169
// pins based on this state == if no last request then == 0xFFFF.
170
170
uint16_t _lastRequest;
@@ -188,6 +188,8 @@ class ADS1013 : public ADS1X15
188
188
{
189
189
public:
190
190
ADS1013 (uint8_t Address = ADS1015_ADDRESS, TwoWire *wire = &Wire);
191
+ void setGain (uint8_t gain);
192
+ uint8_t getGain ();
191
193
};
192
194
193
195
@@ -217,6 +219,8 @@ class ADS1113 : public ADS1X15
217
219
{
218
220
public:
219
221
ADS1113 (uint8_t address = ADS1115_ADDRESS, TwoWire *wire = &Wire);
222
+ void setGain (uint8_t gain);
223
+ uint8_t getGain ();
220
224
};
221
225
222
226
0 commit comments