Other Parts Discussed in Thread: MSP432E401Y, SYSCONFIG
Hello everyone,
I just wrote C code for MSP432E401Y to read data from the MPU6050 sensor. The code is built and flashed with no errors.
I configured the MPU6050 directly to the MSP432E401Y for I2C as follows:
VCC ----V3V
GND ----- GND
SCL ------- PD2
SDA ------ PD3
I use PuTTY for UART display
It supposed to show the Accelerometer, Gyro and Temperature, but unfortunately, I did not see any displayed result
The following is some part of the code that displays information about sensor data.
// I2C CONFIG
I2C_Params_init(&mpu6050Params);
mpu6050Params.bitRate = I2C_400kHz;
mpu6050Params.transferMode = I2C_MODE_BLOCKING;
mpu6050Handle = I2C_open(CONFIG_I2C_0, &mpu6050Params);
MPU6050_Reset();
while (1)
{
MPU6050_ReadData(accel_data, gyro_data, &temperature);
// Display sensor data on UART
Display_print3(uartHandle, 0, 0, "Accelerometer X_AXIS=%d Y_AXIS=%d Z_AXIS=%d\r\n", accel_data[0], accel_data[1], accel_data[2]);
Display_print3(uartHandle, 1, 0, "Gyroscope X_AXIS=%d Y_AXIS=%d Z_AXIS=%d\r\n", gyro_data[0], gyro_data[1], gyro_data[2]);
Display_printf(uartHandle, 2, 0, "Temperature = %.2f °C\r\n", (float)(temperature / 340.0) + 36.53);
// Sleep for a shorter duration (adjust as needed)
usleep(100000); // sleep for 100,000 microseconds (0.1 seconds)
}
}



