tobymurray / esp32-ads1115 Goto Github PK
View Code? Open in Web Editor NEWUse ESP-IDF to read an ADS1115
Use ESP-IDF to read an ADS1115
hello, I'm working on a project where Im using the ads1115 with esp32 .
Im using ESPIDF v4.2 in let me know if you getting feel any update or need to change here.
// Select configuration register(0x01)
// AINP = AIN0 reading voltage
// Continuous conversion mode, 128 SPS(0xC1, 0x83)
hardware is fine and working I checked in Arduino IDE but here I'm only getting reading 0x5E, 0x5E
static esp_err_t i2c_master_sensor_test(i2c_port_t i2c_num, uint8_t *data_h, uint8_t *data_l)
{
int ret;
i2c_cmd_handle_t cmd = i2c_cmd_link_create();
i2c_master_start(cmd);
i2c_master_write_byte(cmd, 0x90, 0x01);
i2c_master_write_byte(cmd, 0x01, 0x01);
i2c_master_write_byte(cmd, 0xC1, 0x01);
i2c_master_write_byte(cmd, 0x83, 0x00);
i2c_master_stop(cmd);
ret = i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_RATE_MS);
i2c_cmd_link_delete(cmd);
if (ret != ESP_OK) {
return ret;
}
vTaskDelay(30 / portTICK_RATE_MS);
cmd = i2c_cmd_link_create();
i2c_master_start(cmd);
i2c_master_write_byte(cmd, 0x91, 0x01);
i2c_master_write_byte(cmd, 0x00, 0x01); //..............<< here not receving ACK
i2c_master_read_byte(cmd, data_h, 0x00);
i2c_master_read_byte(cmd, data_l, 0x01);
i2c_master_stop(cmd);
ret = i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_RATE_MS);
i2c_cmd_link_delete(cmd);
printf(" >> data_h: %X\n", *data_h);
printf(" >> data_l: %X\n", *data_l);
return ret;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.