summaryrefslogtreecommitdiffstats
path: root/src/ADS1115_WE.h
diff options
context:
space:
mode:
authorWolfgang (Wolle) Ewald <wolfgang.ewald@wolles-elektronikkiste.de>2020-08-04 18:56:52 +0200
committerGitHub <noreply@github.com>2020-08-04 18:56:52 +0200
commit43401e0461c7c3073cc57ec6050d2cae5ab4299f (patch)
tree8b5d3c8c4bd01d59563b6e7d976ca26dbbdfc5fe /src/ADS1115_WE.h
parentUpdate ADS1115_WE.h (diff)
downloadADS1115_WE-43401e0461c7c3073cc57ec6050d2cae5ab4299f.tar
ADS1115_WE-43401e0461c7c3073cc57ec6050d2cae5ab4299f.tar.gz
ADS1115_WE-43401e0461c7c3073cc57ec6050d2cae5ab4299f.tar.bz2
ADS1115_WE-43401e0461c7c3073cc57ec6050d2cae5ab4299f.tar.lz
ADS1115_WE-43401e0461c7c3073cc57ec6050d2cae5ab4299f.tar.xz
ADS1115_WE-43401e0461c7c3073cc57ec6050d2cae5ab4299f.tar.zst
ADS1115_WE-43401e0461c7c3073cc57ec6050d2cae5ab4299f.zip
Diffstat (limited to 'src/ADS1115_WE.h')
-rw-r--r--src/ADS1115_WE.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/ADS1115_WE.h b/src/ADS1115_WE.h
index 115d4bd..ce0cec2 100644
--- a/src/ADS1115_WE.h
+++ b/src/ADS1115_WE.h
@@ -27,10 +27,10 @@
#include <Wire.h>
/* registers */
-#define ADS1115_CONV_REG 0x00 //Conversion Register
-#define ADS1115_CONFIG_REG 0x01 //Configuration Register
-#define ADS1115_LO_THRESH_REG 0x02 //Low Threshold Register
-#define ADS1115_HI_THRESH_REG 0x03 //High Threshold Register
+#define ADS1115_CONV_REG 0x00 //Conversion Register
+#define ADS1115_CONFIG_REG 0x01 //Configuration Register
+#define ADS1115_LO_THRESH_REG 0x02 //Low Threshold Register
+#define ADS1115_HI_THRESH_REG 0x03 //High Threshold Register
/* other */
#define ADS1115_REG_FACTOR 32768
@@ -76,12 +76,12 @@ typedef enum ADS1115_MEASURE_MODE{
} measureMode;
typedef enum ADS1115_RANGE{
- ADS1115_RANGE_6144 = 0x0000,
- ADS1115_RANGE_4096 = 0x0200,
+ ADS1115_RANGE_6144 = 0x0000,
+ ADS1115_RANGE_4096 = 0x0200,
ADS1115_RANGE_2048 = 0x0400,
- ADS1115_RANGE_1024 = 0x0600,
- ADS1115_RANGE_0512 = 0x0800,
- ADS1115_RANGE_0256 = 0x0A00,
+ ADS1115_RANGE_1024 = 0x0600,
+ ADS1115_RANGE_0512 = 0x0800,
+ ADS1115_RANGE_0256 = 0x0A00,
} range;
typedef enum ADS1115_MUX{
@@ -96,7 +96,7 @@ typedef enum ADS1115_MUX{
} mux;
typedef enum ADS1115_STATUS_OR_START{
- ADS1115_BUSY = 0x0000,
+ ADS1115_BUSY = 0x0000,
ADS1115_START_ISREADY = 0x8000
} statusOrStart;
@@ -202,10 +202,10 @@ public:
void startSingleMeasurement();
float getResult_V();
float getResult_mV();
+ int16_t getResultWithRange(int16_t min, int16_t max);
/* With this function the alert pin will be active, when a conversion is ready.
- * In order to deactivate the conversion ready alert, use
- * setAlertPinMode(ADS1115_DISABLE_ALERT) or setAlertModeAndLimit_V()
+ * In order to deactivate, use the setAlertLimit_V function
*/
void setAlertPinToConversionReady();
void clearAlert();