mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-07 22:24:26 +00:00
.
This commit is contained in:
@@ -1 +1 @@
|
||||
45402d83d488f1ce7a3c15edf02cd5a1 C:/Users/alex/github/ESP-Nodes/ESP32-IDF_BMP280/build/ESP32-IDF_BMP280.bin
|
||||
adfa3d832f35a82053b44aca68a50af4 C:/Users/alex/github/ESP-Nodes/ESP32-IDF_BMP280/build/ESP32-IDF_BMP280.bin
|
||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1 +1 @@
|
||||
381e1c15d2ff7c065aa2adf8eb6d72b8cf466a6d
|
||||
395926bd256a493c6258f4f99daf2d1f7bf880b2
|
||||
|
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -135,3 +135,15 @@
|
||||
84 315 0 C:/Users/alex/github/ESP-Nodes/ESP32-IDF_BMP280/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 29d6c89823153d61
|
||||
34 240 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size 29d6c89823153d61
|
||||
34 240 0 C:/Users/alex/github/ESP-Nodes/ESP32-IDF_BMP280/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 29d6c89823153d61
|
||||
132 695 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size 29d6c89823153d61
|
||||
132 695 0 C:/Users/alex/github/ESP-Nodes/ESP32-IDF_BMP280/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 29d6c89823153d61
|
||||
43 418 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size 29d6c89823153d61
|
||||
43 418 0 C:/Users/alex/github/ESP-Nodes/ESP32-IDF_BMP280/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 29d6c89823153d61
|
||||
41 255 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size 29d6c89823153d61
|
||||
41 255 0 C:/Users/alex/github/ESP-Nodes/ESP32-IDF_BMP280/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 29d6c89823153d61
|
||||
42 214 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size 29d6c89823153d61
|
||||
42 214 0 C:/Users/alex/github/ESP-Nodes/ESP32-IDF_BMP280/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 29d6c89823153d61
|
||||
35 201 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size 29d6c89823153d61
|
||||
35 201 0 C:/Users/alex/github/ESP-Nodes/ESP32-IDF_BMP280/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 29d6c89823153d61
|
||||
50 709 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size 29d6c89823153d61
|
||||
50 709 0 C:/Users/alex/github/ESP-Nodes/ESP32-IDF_BMP280/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 29d6c89823153d61
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"version": "1.1",
|
||||
"project_name": "ESP32-IDF_BMP280",
|
||||
"project_version": "381e1c1-dirty",
|
||||
"project_version": "395926b-dirty",
|
||||
"project_path": "C:/Users/alex/github/ESP-Nodes/ESP32-IDF_BMP280",
|
||||
"idf_path": "C:/Users/alex/esp/v5.2.2/esp-idf",
|
||||
"build_dir": "C:/Users/alex/github/ESP-Nodes/ESP32-IDF_BMP280/build",
|
||||
@@ -805,7 +805,7 @@
|
||||
"managed_reqs": [],
|
||||
"managed_priv_reqs": [],
|
||||
"file": "C:/Users/alex/github/ESP-Nodes/ESP32-IDF_BMP280/build/esp-idf/main/libmain.a",
|
||||
"sources": [ "C:/Users/alex/github/ESP-Nodes/ESP32-IDF_BMP280/main/main.c" ],
|
||||
"sources": [ "C:/Users/alex/github/ESP-Nodes/ESP32-IDF_BMP280/main/bme280.c", "C:/Users/alex/github/ESP-Nodes/ESP32-IDF_BMP280/main/main.c" ],
|
||||
"include_dirs": [ "." ]
|
||||
},
|
||||
"mbedtls": {
|
||||
|
@@ -22,5 +22,8 @@
|
||||
* 0xFA-0xFC -> Temperature -> 16- to 20-bit resolution, unsigned
|
||||
* 0xFD-0xFE -> Humidity -> 16-bit resolution
|
||||
*/
|
||||
#define BME280_TEMPERATURE_REGISTER (0xFA)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@@ -55,19 +55,18 @@ static esp_err_t mpu9250_register_read(uint8_t reg_addr, uint8_t *data, size_t l
|
||||
//error = i2c_master_write_read_device(I2C_MASTER_NUM, MPU9250_SENSOR_ADDR, ®ister_address, 1, registers_data, count, I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS);
|
||||
}*/
|
||||
|
||||
static esp_err_t bme280_read_raw_temperature(uint8_t device_address, uint8_t *raw_temperature_u32) {
|
||||
static esp_err_t bme280_read_raw_temperature(uint8_t device_address, uint8_t *raw_temperature) {
|
||||
// BME280_INIT_VALUE LN 136
|
||||
// BME280_TEMPERATURE_MSB_REG 0xFA
|
||||
// BME280_TEMPERATURE_DATA_LENGTH
|
||||
// BME280_TEMPERATURE_DATA_SIZE
|
||||
// I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS
|
||||
|
||||
int command_result = 0;
|
||||
unsigned char raw_temperature[BME280_TEMPERATURE_DATA_SIZE] = {0, 0, 0};
|
||||
esp_err_t command_result;
|
||||
//unsigned char raw_temperature[BME280_TEMPERATURE_DATA_SIZE] = {0, 0, 0};
|
||||
//command_result = i2c_master_read_from_device(0, BME280_I2C_ADDRESS1, *raw_temperature, BME280_TEMPERATURE_DATA_SIZE, I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS);
|
||||
command_result = i2c_master_write_read_device(0, BME280_I2C_ADDRESS1, *raw_temperature, BME280_TEMPERATURE_DATA_SIZE, *BME, 1, I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS);
|
||||
|
||||
|
||||
command_result = i2c_master_write_read_device(0, BME280_I2C_ADDRESS1, *raw_temperature, BME280_TEMPERATURE_DATA_SIZE, BME280_TEMPERATURE_REGISTER, 1, I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS);
|
||||
return command_result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,15 +106,23 @@ static esp_err_t i2c_master_init(void)
|
||||
void app_main(void)
|
||||
{
|
||||
uint8_t data[2];
|
||||
uint8_t raw_temp[BME280_TEMPERATURE_DATA_SIZE] = {0,0,0};
|
||||
|
||||
ESP_ERROR_CHECK(i2c_master_init());
|
||||
ESP_LOGI(TAG, "I2C initialized successfully");
|
||||
|
||||
/* Read the MPU9250 WHO_AM_I register, on power up the register should have the value 0x71 */
|
||||
|
||||
int read = i2c_master_read_from_device(0, 0x76, data, 1, I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS);
|
||||
int read = 0;
|
||||
read = i2c_master_read_from_device(0, 0x76, data, 1, I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS);
|
||||
//int read = i2c_master_write_read_device(0, 0x76, 0xD0, 1, data, 1024, I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS);
|
||||
//ESP_ERROR_CHECK(mpu9250_register_read(MPU9250_WHO_AM_I_REG_ADDR, data, 1));
|
||||
ESP_LOGI(TAG, "WHO_AM_I = %X", data[0]);
|
||||
ESP_ERROR_CHECK(i2c_driver_delete(I2C_MASTER_NUM));
|
||||
ESP_LOGI(TAG, "I2C de-initialized successfully");
|
||||
|
||||
read = bme280_read_raw_temperature(0x76, raw_temp);
|
||||
ESP_LOGI(TAG, "Raw Temperature: %X", raw_temp[0]);
|
||||
|
||||
/* Demonstrate writing by reseting the MPU9250 */
|
||||
//ESP_ERROR_CHECK(mpu9250_register_write_byte(MPU9250_PWR_MGMT_1_REG_ADDR, 1 << MPU9250_RESET_BIT));
|
||||
|
Reference in New Issue
Block a user