How to transmit structure variables from .h library via the serial port?
I am trying to transmit variables via the uart2 serial port from GY-521(mpu6050) library, however, all my attempts are unsuccessful.
typedef init in the main.c:
MPU6050_t sensor_data;
main.c area to put HAL_UART_Transmit():
while (1)
{
MPU6050_Read_All(&hi2c1, &sensor_data);
HAL_Delay(100);
}
.h needed structure variables to transmit into serial port:
typedef struct
{
int16_t Accel_X_RAW;
int16_t Accel_Y_RAW;
int16_t Accel_Z_RAW;
double Ax;
double Ay;
double Az;
int16_t Gyro_X_RAW;
int16_t Gyro_Y_RAW;
int16_t Gyro_Z_RAW;
double Gx;
double Gy;
double Gz;
float Temperature;
double KalmanAngleX;
double KalmanAngleY;
} MPU6050_t;
