From 6b64fa50a422eaac9098fe6e1123c52490ad7485 Mon Sep 17 00:00:00 2001 From: Ollo Date: Thu, 4 Feb 2021 21:10:21 +0100 Subject: [PATCH] Read Page7 and debug print it --- esp32test/Esp32DeepSleepTest/src/DS2438.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/esp32test/Esp32DeepSleepTest/src/DS2438.cpp b/esp32test/Esp32DeepSleepTest/src/DS2438.cpp index 1fafb8e..5e429ae 100644 --- a/esp32test/Esp32DeepSleepTest/src/DS2438.cpp +++ b/esp32test/Esp32DeepSleepTest/src/DS2438.cpp @@ -119,6 +119,14 @@ void DS2438::update() { int16_t fullByte = (upperByte | lowerByte); _current = ((float)fullByte) / (4096.0f * _currentShunt); _error = false; + + if (!readPage(7, data)){ + PageSeven_t *pSeven = (PageSeven_t *) data; + int16_t CCA = pSeven->CCA0 | ((int16_t) pSeven->CCA1) << 8; + int16_t DCA = pSeven->DCA0 | ((int16_t) pSeven->DCA1) << 8; + Serial.printf("DCA: %d. CCA: %d\n", DCA, CCA); + } + } double DS2438::getTemperature() {