Comments (4)
Hi! You need separate descriptors for each i2c device.
from esp-idf-lib.
@UncleRus oky so i work with detected device so i can create instance with malloc bcs number of device is detected with i2ccannser
now i create max :
//
static float pressure, temperature, humidity;
static bmp280_t dev_bme280 [8] = {0};
static bmp280_params_t params_bme280 [8] = {0};
//
uint16_t lux;
i2c_dev_t dev_bh1750[8]= {0};
/***************************************************/
i2c_dev_t dev_pcf8574[8];
uint16_t read_port_pcf8574;
/****************************************************/
from esp-idf-lib.
Yes you can create device descriptors dynamically, e.g.
i2c_dev_t *bh1750; // pointer to device descriptor
...
bh1750 = malloc(sizeof(i2c_dev_t)); // allocate memory for descriptor
memset(bh1750, 0, sizeof(i2c_dev_t))); // fill it with zeroes
... // init descriptor, init device, use it
free(bh1750); // free allocated memory
from esp-idf-lib.
Ah yes yes but for sensor i don't think I free memory bcs I use all time read_bh1750 and I don't initialize device for each read
So it's don't give problem if I don't use free(p) ?
from esp-idf-lib.
Related Issues (20)
- SR04 ultrasonic sonar issue HOT 3
- Porting VL53L1X driver HOT 1
- ACK issue in wake up command in SCD4x component HOT 1
- cmake fails HOT 3
- Encoder: Example panics HOT 2
- HX711: Calibration factor (float required) HOT 1
- Redundant i_expected_max parameter when calibrating ina219
- MCP23017 Example throws an error when using interrupts HOT 2
- Write to config register triggers start conversion on ADS1115
- Support for BQ27441-G1
- Having issues using the TCA9548 code for my VEML7700
- SHT4x often gives "i2cdev: Could not read from device [0x44 at 0]" error on measurement HOT 2
- Strange behavior with BME280 + MAX17048 HOT 4
- Problem with nested structs in BME680-Driver / IĀ²C-init
- error in bme680_convert_temperature() when temperature is below 0 HOT 2
- Unable to read from HX711 with esp-idf-lib HOT 2
- Watchdog timer reset after BME280 initialization on ESP32C3 HOT 1
- INA219 - Wrong current reading
- Integration Proposal for Software Testing using Wokwi Simulator CI in esp-idf-lib
- [sht3x]: i2cdev: Could not write to device [0x44 at 0] HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp-idf-lib.