Hello everyone,
I have an ESP32 board connected with an IMU. I want to make few alterations on the IMU like hardcoding the calibration offsets values in order to use them every time the board powers on. My main concern is how can I write directly to the registers from the Arduino IDE platform. I imagine that this has to do mainly with C# programming and specifically with ESP32 but any help will be useful.
Thank you
ESP32 write to registers
-
- Posts: 46
- Joined: Fri Aug 02, 2019 11:59 pm
Re: ESP32 write to registers
You essentially have to select the SPI device you want to address and then execute a SPI transaction using something like `spi_device_transmit()` etc. Don't forget to unselect the SPI device afterwards to make it available to other processes.
Re: ESP32 write to registers
Which protocol do you need? ESP-IDF gives you a lot of libraries you can use for communication.bssmith237 wrote: ↑Wed Sep 22, 2021 7:37 amMy main concern is how can I write directly to the registers from the Arduino IDE platform.
If you use Arduino IDE I think you installed the esp32 pack of libraries in the IDE.
Filippo
-
- Posts: 2
- Joined: Wed Sep 22, 2021 7:34 am
Re: ESP32 write to registers
Thank you for your answer,filo_gr wrote: ↑Thu Sep 23, 2021 10:04 amWhich protocol do you need? ESP-IDF gives you a lot of libraries you can use for communication.bssmith237 wrote: ↑Wed Sep 22, 2021 7:37 amMy main concern is how can I write directly to the registers from the Arduino IDE platform.
If you use Arduino IDE I think you installed the esp32 pack of libraries in the IDE.
Yes I have installed the esp32 pack. So I should look for ESP-IDF package. I will try and inform you upon my outcome.
Re: ESP32 write to registers
Code: Select all
Wire.beginTransmission((uint8_t)ADDRESS); // I2C address
Wire.write((uint8_t)0x1); // register address
Wire.write((uint8_t)136); // write byte/bytes
Wire.endTransmission(); // end
Who is online
Users browsing this forum: amiral and 88 guests