mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-10-23 18:53:29 +00:00
esp32 temperature node
This commit is contained in:
@@ -33,19 +33,7 @@
|
|||||||
static bme280_handle_t sensor = NULL;
|
static bme280_handle_t sensor = NULL;
|
||||||
float temperature = 0.0f;
|
float temperature = 0.0f;
|
||||||
|
|
||||||
void i2c_master_init(void)
|
|
||||||
{
|
|
||||||
i2c_config_t conf = {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = I2C_MASTER_SDA_IO,
|
|
||||||
.scl_io_num = I2C_MASTER_SCL_IO,
|
|
||||||
.sda_pullup_en = GPIO_PULLUP_ENABLE,
|
|
||||||
.scl_pullup_en = GPIO_PULLUP_ENABLE,
|
|
||||||
.master.clk_speed = I2C_MASTER_FREQ_HZ,
|
|
||||||
};
|
|
||||||
i2c_param_config(I2C_MASTER_NUM, &conf);
|
|
||||||
i2c_driver_install(I2C_MASTER_NUM, conf.mode, I2C_MASTER_RX_BUF_DISABLE, I2C_MASTER_TX_BUF_DISABLE, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void app_main(void)
|
void app_main(void)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user