Dwi259eti | Firmware

static const char *TAG = "my_feature";

nvs_handle_t h; ESP_ERROR_CHECK(nvs_open("my_feat", NVS_READWRITE, &h)); ESP_ERROR_CHECK(nvs_set_blob(h, "threshold", &thr, sizeof(thr))); ESP_ERROR_CHECK(nvs_commit(h)); nvs_close(h); return ESP_OK; Dwi259eti Firmware

/* Example: read a temperature sensor on I2C address 0x48 */ int my_feature_get_temperature(float *temp_c) I2C_MASTER_WRITE, true); i2c_master_write_byte(cmd, 0x00, true); // register address i2c_master_stop(cmd); esp_err_t err = i2c_master_cmd_begin(I2C_NUM_0, cmd, 1000 / portTICK_PERIOD_MS); i2c_cmd_link_delete(cmd); if (err != ESP_OK) return -1; static const char *TAG = "my_feature"; nvs_handle_t h;