From da631bb6a06d2e03bf6f48adfdfa79dc3072c66b Mon Sep 17 00:00:00 2001 From: gnxlxnxx Date: Sun, 17 Dec 2023 20:42:15 +0100 Subject: [PATCH] Fixes --- components/empty_i2c_component/empty_i2c_component.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/empty_i2c_component/empty_i2c_component.cpp b/components/empty_i2c_component/empty_i2c_component.cpp index c005daf..4281d96 100644 --- a/components/empty_i2c_component/empty_i2c_component.cpp +++ b/components/empty_i2c_component/empty_i2c_component.cpp @@ -1,5 +1,6 @@ #include "esphome/core/log.h" #include "empty_i2c_component.h" +#include namespace esphome { namespace empty_i2c_component { @@ -7,13 +8,14 @@ namespace empty_i2c_component { static const char *TAG = "empty_i2c_component.component"; void EmptyI2CComponent::setup() { - this->write_register(0x0, 0x1, 0x1); } void EmptyI2CComponent::loop() { - this->write_register(0x0, 0x1, 0x1); + uint8_t data = 0x1; + this->write_register(0x0, &data, 0x1); delay(1000); - this->write_register(0x0, 0x0, 0x1); + data = 0x0; + this->write_register(0x0, &data, 0x1); delay(1000); }