This commit is contained in:
2024-07-09 14:42:28 -04:00
parent 3934466829
commit 7b298995bb
2 changed files with 23 additions and 13 deletions

View File

@@ -1,9 +1,11 @@
#ifndef __BME280_H__
#define __BME280_H__
#define BME280_CHIP_ID (0x60)
#define BME280_CHIP_ID (0xD0)
#define BME280_I2C_ADDRESS1 (0x76) // BME280 Data sheet p. 32
#define BME280_I2C_ADDRESS2 (0x77)
#define BME280_TEMPERATURE_REGISTER (0xFA)
#define BME280_TEMPERATURE_DATA_SIZE (3)
#define BME280_TEMPERATURE_DATA_LENGTH (3)
#define BME280_PRESSURE_DATA_SIZE (3)
@@ -22,7 +24,7 @@
* 0xFA-0xFC -> Temperature -> 16- to 20-bit resolution, unsigned
* 0xFD-0xFE -> Humidity -> 16-bit resolution
*/
#define BME280_TEMPERATURE_REGISTER (0xFA)
#endif

View File

@@ -1,20 +1,28 @@
/* i2c - Simple example
Simple I2C example that shows how to initialize I2C
as well as reading and writing from and to registers for a sensor connected over I2C.
/* ESP32 Module I2C Master Device
The sensor used in this example is a MPU9250 inertial measurement unit.
Author: Alexander Bobkov
Date: July 3, 2024
Modified: July 9, 2024
Adopted from i2c - Simple example
For other examples please check:
https://github.com/espressif/esp-idf/tree/master/examples
Simple I2C example that shows how to initialize I2C
as well as reading and writing from and to registers for a sensor connected over I2C.
See README.md file to get detailed usage of this example.
The sensor used in this example is a MPU9250 inertial measurement unit.
This example code is in the Public Domain (or CC0 licensed, at your option.)
For other examples please check:
https://github.com/espressif/esp-idf/tree/master/examples
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
See README.md file to get detailed usage of this example.
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include "esp_log.h"