Page 1 of 1

Hi , can anyone say , how to write the values to the specific register through I2C..??

Posted: Wed Apr 12, 2017 1:51 pm
by Reeshma
Am a beginner to this platform , i don't know how to write the value to the specific register.
I just want like this...in esp32


const int MPU_addr=0x68;
const int ACCEL_CFG=0x1c;

Wire.beginTransmission(MPU_addr); // write the data to ACCEL_CFG
Wire.write(ACCEL_CFG);
Wire.write(0x01);
Wire.endTransmission();

can anyone say what change will i need to do , while interfacing the mpu6050 with esp32.

Re: Hi , can anyone say , how to write the values to the specific register through I2C..??

Posted: Wed Apr 12, 2017 9:48 pm
by Hans Dorn
There's an arduino core available for the esp32, if you want to use the arduino libraries.

https://github.com/espressif/arduino-esp32

Re: Hi , can anyone say , how to write the values to the specific register through I2C..??

Posted: Thu Apr 13, 2017 3:01 am
by kolban
Here are a couple of samples where we managed to get the MPU6050 working with C and C++ in ESP-IDF:

https://github.com/nkolban/esp32-snippe ... lerometers

and

https://github.com/nkolban/esp32-snippe ... PU6050.cpp

Re: Hi , can anyone say , how to write the values to the specific register through I2C..??

Posted: Thu Apr 13, 2017 4:55 am
by Reeshma
Thank you sir , the code had you posted its all related to reading the values from the register,
but now i want to write the values to the register through I2c and also to read the values from the register. Can anyone say how to do..?

Re: Hi , can anyone say , how to write the values to the specific register through I2C..??

Posted: Thu Apr 13, 2017 8:02 am
by preetam
Hi,

There is an example in esp idf at https://github.com/espressif/esp-idf/tr ... herals/i2c.

I was working on max10305 and below is the flow of execution.

1. check whether the part id matches.. i2c write with i2c address of max10305 and read the part id address
2. setup the power level, adc range etc.. 6 i2c writes.
3. read the values required.

As per my understanding after working with bme280 and max10305. we need to setup the i2c slaves before we can read the temperature, pressure from bme280.

Thank you
Paul

Re: Hi , can anyone say , how to write the values to the specific register through I2C..??

Posted: Mon Apr 17, 2017 6:29 am
by Reeshma
Ok sir , thank you , i will try

Re: Hi , can anyone say , how to write the values to the specific register through I2C..??

Posted: Mon Apr 17, 2017 4:53 pm
by rsimpsonbusa