diff options
author | Wolfgang (Wolle) Ewald <wolfgang.ewald@wolles-elektronikkiste.de> | 2021-05-14 17:58:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-14 17:58:51 +0200 |
commit | fea9316ea6b07bd70120c3eec001fdf3f94158bd (patch) | |
tree | 8872f191094239a23d55a0d366a9ffd13fd45041 /examples | |
parent | Update library.properties (diff) | |
download | ADS1115_WE-fea9316ea6b07bd70120c3eec001fdf3f94158bd.tar ADS1115_WE-fea9316ea6b07bd70120c3eec001fdf3f94158bd.tar.gz ADS1115_WE-fea9316ea6b07bd70120c3eec001fdf3f94158bd.tar.bz2 ADS1115_WE-fea9316ea6b07bd70120c3eec001fdf3f94158bd.tar.lz ADS1115_WE-fea9316ea6b07bd70120c3eec001fdf3f94158bd.tar.xz ADS1115_WE-fea9316ea6b07bd70120c3eec001fdf3f94158bd.tar.zst ADS1115_WE-fea9316ea6b07bd70120c3eec001fdf3f94158bd.zip |
Diffstat (limited to 'examples')
-rw-r--r-- | examples/Single_Shot/Single_Shot.ino | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/Single_Shot/Single_Shot.ino b/examples/Single_Shot/Single_Shot.ino index 1e8b085..f1f7dc6 100644 --- a/examples/Single_Shot/Single_Shot.ino +++ b/examples/Single_Shot/Single_Shot.ino @@ -13,8 +13,14 @@ #include<Wire.h>
#define I2C_ADDRESS 0x48
-ADS1115_WE adc(I2C_ADDRESS);
-// ADS1115_WE adc = ADS1115_WE(); // Alternative: uses default address 0x48
+/* There are several ways to create your ADS1115_WE object:
+ * ADS1115_WE adc = ADS1115_WE() -> uses Wire / I2C Address = 0x48
+ * ADS1115_WE adc = ADS1115_WE(I2C_ADDRESS) -> uses Wire / I2C_ADDRESS
+ * ADS1115_WE adc = ADS1115_WE(&wire2) -> uses the TwoWire object wire2 / I2C_ADDRESS
+ * ADS1115_WE adc = ADS1115_WE(&wire2, I2C_ADDRESS) -> all together
+ * Successfully tested with two I2C busses on an ESP32
+ */
+ADS1115_WE adc = ADS1115_WE(I2C_ADDRESS);
void setup() {
Wire.begin();
|