From bdc67b3217e78aab10bd6a2ea61df0bab09121c5 Mon Sep 17 00:00:00 2001 From: ladyada Date: Mon, 2 Dec 2024 14:26:55 -0500 Subject: [PATCH] some chips seem to read id 0x00 :/ cc @foamyguy --- Adafruit_MMC56x3.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Adafruit_MMC56x3.cpp b/Adafruit_MMC56x3.cpp index b250d6a..4fdff1c 100644 --- a/Adafruit_MMC56x3.cpp +++ b/Adafruit_MMC56x3.cpp @@ -81,7 +81,8 @@ bool Adafruit_MMC5603::begin(uint8_t i2c_address, TwoWire *wire) { Adafruit_BusIO_Register(i2c_dev, MMC56X3_PRODUCT_ID); // make sure we're talking to the right chip - if (chip_id.read() != MMC56X3_CHIP_ID) { + uint8_t id = chip_id.read(); + if ((id != MMC56X3_CHIP_ID) && (id != 0x0)) { // No MMC56X3 detected ... return false return false; }