|
|
|
@ -1,5 +1,8 @@
|
|
|
|
#include "esphome/core/log.h"
|
|
|
|
#include "esphome/core/log.h"
|
|
|
|
#include "empty_i2c_sensor.h"
|
|
|
|
#include "empty_i2c_sensor.h"
|
|
|
|
|
|
|
|
#include "esphome/core/log.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const char* const TAG = "i2c sensor";
|
|
|
|
|
|
|
|
|
|
|
|
namespace esphome {
|
|
|
|
namespace esphome {
|
|
|
|
namespace empty_i2c_sensor {
|
|
|
|
namespace empty_i2c_sensor {
|
|
|
|
@ -11,6 +14,9 @@ void EmptyI2CSensor::setup(){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void EmptyI2CSensor::update(){
|
|
|
|
void EmptyI2CSensor::update(){
|
|
|
|
|
|
|
|
uint8_t data[] = {10};
|
|
|
|
|
|
|
|
this->write_register(0x0, &data, 0x1);
|
|
|
|
|
|
|
|
ESP_LOGI(TAG, "sensor output: %d", data[0]);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|