From 3b845f1ad7a8d2d5374314fe8d7e6adb9ef6fb3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 1 May 2023 17:47:15 +0200 Subject: add toggle to skip ch switch delays --- src/ADS1115_WE.cpp | 4 +++- src/ADS1115_WE.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ADS1115_WE.cpp b/src/ADS1115_WE.cpp index 0716372..b7652e8 100644 --- a/src/ADS1115_WE.cpp +++ b/src/ADS1115_WE.cpp @@ -190,6 +190,8 @@ void ADS1115_WE::setPermanentAutoRangeMode(bool autoMode){ } void ADS1115_WE::delayAccToRate(convRate cr){ + if (skip_delays) + return; switch(cr){ case ADS1115_8_SPS: delay(130); @@ -351,4 +353,4 @@ uint16_t ADS1115_WE::readRegister(uint8_t reg){ #endif regValue = (MSByte<<8) + LSByte; return regValue; -} \ No newline at end of file +} diff --git a/src/ADS1115_WE.h b/src/ADS1115_WE.h index 5cb3eb2..6f1626c 100644 --- a/src/ADS1115_WE.h +++ b/src/ADS1115_WE.h @@ -274,6 +274,7 @@ class ADS1115_WE void setAlertPinToConversionReady(); void clearAlert(); + bool skip_delays; protected: #ifndef USE_TINY_WIRE_M_ -- cgit v1.2.3