From bfbc45674f67fda5af1ab42080fe51e287df018b Mon Sep 17 00:00:00 2001 From: Neil McKechnie Date: Sun, 22 Jan 2023 12:38:24 +0000 Subject: [PATCH] Update IO_AnalogueInputs.h Add I2C initialisation calls (previously missing). --- IO_AnalogueInputs.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/IO_AnalogueInputs.h b/IO_AnalogueInputs.h index 1af351d..5f9d0e0 100644 --- a/IO_AnalogueInputs.h +++ b/IO_AnalogueInputs.h @@ -73,6 +73,11 @@ private: addDevice(this); } void _begin() { + // Initialise I2C + I2CManager.begin(); + // ADS111x support high-speed I2C (4.3MHz) but that requires special + // processing. So stick to fast mode (400kHz maximum). + I2CManager.setClock(400000); // Initialise ADS device if (I2CManager.exists(_i2cAddress)) { _nextState = STATE_STARTSCAN;