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.
Hi , can anyone say , how to write the values to the specific register through I2C..??
Re: Hi , can anyone say , how to write the values to the specific register through I2C..??
There's an arduino core available for the esp32, if you want to use the arduino libraries.
https://github.com/espressif/arduino-esp32
https://github.com/espressif/arduino-esp32
Re: Hi , can anyone say , how to write the values to the specific register through I2C..??
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
https://github.com/nkolban/esp32-snippe ... lerometers
and
https://github.com/nkolban/esp32-snippe ... PU6050.cpp
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Hi , can anyone say , how to write the values to the specific register through I2C..??
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..?
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..??
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
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..??
Ok sir , thank you , i will try
-
- Posts: 126
- Joined: Tue May 17, 2016 8:12 pm
Who is online
Users browsing this forum: No registered users and 87 guests