I am currently exploring the I2C Communication using AMB82 Board.
When I interfaced MPU6050 with AMB82 and got raw_data, acceleration Values
which is working fine.
But When I want to display that data on OLED then it’s not working properly.
here is the code
#include “I2Cdev.h”
#include “MPU6050_IMU_libraries/MPU6050.h”
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
#include “Wire.h”
#endif
#include <Adafruit_OLED_libraries/Adafruit_GFX.h>
#include <Adafruit_OLED_libraries/Adafruit_SSD1306.h>
// OLED definitions
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define SCREEN_ADDRESS 0x3C // OLED I2C address checked by I2C scanner
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
MPU6050 mpu;
int16_t ax_raw, ay_raw, az_raw;
float ax, ay, az;
void setup() {
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
Wire.begin();
#elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
Fastwire::setup(400, true);
#endif
Serial.begin(115200);
Serial.println(“Initializing MPU6050…”);
mpu.initialize();
if (mpu.testConnection()) {
Serial.println(“MPU6050 connection successful”);
} else {
Serial.println(“MPU6050 connection failed”);
}
// Initialize OLED
if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
Serial.println(F(“SSD1306 allocation failed”));
while (true)
; // Stop execution
}
delay(1000); // Let OLED settle
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0, 0);
display.println(“MPU6050 Ready”);
display.display();
}
void loop() {
mpu.getAcceleration(&ax_raw, &ay_raw, &az_raw);
// Convert raw to m/s²
ax = ax_raw * 9.81 / 16384.0;
ay = ay_raw * 9.81 / 16384.0;
az = az_raw * 9.81 / 16384.0;
#ifdef OUTPUT_READABLE_ACCEL_ONLY
Serial.print(“Accel (X, Y, Z):\t”);
Serial.print(ax_raw);
Serial.print(“\t”);
Serial.print(ay_raw);
Serial.print(“\t”);
Serial.println(az_raw);
#endif
// Serial print
Serial.print(“Accel (X, Y, Z) [m/s²]:\t”);
Serial.print(ax, 2);
Serial.print(“\t”);
Serial.print(ay, 2);
Serial.print(“\t”);
Serial.println(az, 2);
// OLED display update
display.clearDisplay();
display.setCursor(0, 0);
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.println(“Acceleration (m/s²)”);
display.print("X: ");
display.println(ax, 2);
display.print("Y: ");
display.println(ay, 2);
display.print("Z: ");
display.println(az, 2);
display.display();
delay(500);
}"
And I got Error like this :
“01:12:08.108 →
[MISC Err]Pin 0[0] is conflicted
01:12:08.108 →
[MISC Err]It’s configured as RFAFE_CTRL/JTAG now.
01:12:08.108 →
[MISC Err]It’s using by peripheral 30000000
01:12:08.108 →
[MISC Err]Pin un-register caller (10000000) is not the owner (30000000)
01:12:08.142 →
[MISC Err]Pin un-register caller (10000000) is not the owner (30000000)
01:12:08.142 →
[MISC Err]Pin 0[0] is conflicted
01:12:08.142 →
[MISC Err]It’s configured as RFAFE_CTRL/JTAG now.
01:12:08.142 →
[MISC Err]It’s using by peripheral 30000000
01:12:08.142 →
[MISC Err]Pin 0[0] is conflicted
01:12:08.142 →
[MISC Err]It’s configured as RFAFE_CTRL/JTAG now.
01:12:08.142 →
[MISC Err]It’s using by peripheral 30000000
01:12:08.174 →
[MISC Err]Pin un-register caller (10000000) is not the owner (30000000)
01:12:08.174 →
[MISC Err]Pin un-register caller (10000000) is not the owner (30000000)
01:12:08.220 →
[MISC Err]Pin 0[0] is conflicted
01:12:08.220 →
[MISC Err]It’s configured as RFAFE_CTRL/JTAG now.
01:12:08.220 →
[MISC Err]It’s using by peripheral 30000000
01:12:08.220 →
[MISC Err]Pin 0[0] is conflicted
01:12:08.220 →
[MISC Err]It’s configured as RFAFE_CTRL/JTAG now.
01:12:08.220 →
[MISC Err]It’s using by peripheral 30000000”
@Kelvin_Huang @KaiFai_Y @M-ichae-l Please Help Sir