0

so today i tried using my seeduino 9dof with my esp32. When i tried using the library that seeduino has made it compiled with this error "avr/pgmspace.h no such file or directory”.

I also tried reading the raw i2c data but i only manage to read either a static 1 or 0.

When i tried using the library that seeduino has made it compiled with this error "avr/pgmspace.h no such file or directory”, this led to me changing a line that called pgmspace in the library to this:

#if defined(AVR)
#include <avr/pgmspace.h>
#else  //defined(AVR)
#include <pgmspace.h>
#endif  //defined(AVR)

which only caused more compiler errors.

After this i tried reading the raw i2c data but did not figure out which pins the esp32 used for i2c since the pinout on the site did not list the i2c pins ( https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/_images/ESP32-S3_DevKitC-1_pinlayout_v1.1.jpg ), butt i figured out it was 19, 20 (Or every PWM pin?). However, i do get the adress from the WireScan script, but when i try to read the data i only get either 1 or 0 and it stays static.

The wirecheck script does say error 5 at 0x6B but i dont use this adress so shouldn't be a problem?

So my 2 options is to get the library working on the esp32, or figure out the i2c communication?

Thanks for any help i can get.

Also here is the code i use to read the i2c data:

#include <Wire.h>



void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Wire.begin(21, 20);
  pinMode(8, OUTPUT);
  digitalWrite(8, HIGH);

}

void loop() {
  // put your main code here, to run repeatedly:
  Wire.requestFrom(0x69, 6);
  float test = Wire.read();
  Serial.println(test);
  delay(100);


}

ZNOW
  • 1
  • Your code sets up I2C on pins 21 and 20 so if you have the device wired to 19 and 20 that's definitely not going to work. The library you mentioned is designed to work on AVR CPUs so it's going to work on an ESP32 without modification. The Seeduino 9dof seems to just be an MPU9250 accelerometer. There are tutorials and libraries for it and the ESP32, so you'd save yourself some trouble just looking for those. – romkey Dec 24 '22 at 01:01

0 Answers0