I'm making my first library for some sensor
In function MPUDataScale()': and when I compile it it says undefined reference to
AcX_out'
AcX_Out is a global variable declared in the h file, defined in the MPUsetup function which is implemented in the cpp file
the variables are declared as extern variables
This error actually is getting for almost all the functions with all the variable
I looked up the other threads that talked about the same error
but I kind spot my problem in my code yet !
MPU.h
// Global variables
extern double timestep,TimeC;
extern int check;
extern double AAngX, AAngY, AAngZ, GAngX, GAngY, GAngZ, AngX, AngY, AngZ;
extern int accel_x_OC, accel_y_OC, accel_z_OC, gyro_x_OC ,gyro_y_OC, gyro_z_OC;
extern int AcX_out , AcY_out, AcZ_out, GyroX_out, GyroY_out, GyroZ_out, Tmp_out;
extern double AcX, AcY, AcZ;
extern double Tmp;
extern double GyX, GyY, GyZ;
MPU.cpp
void MPUSetup(void){
timestep=0;
TimeC=0;
check =0;
accel_x_OC=0;
accel_y_OC=0;
accel_z_OC=0;
gyro_x_OC=0;
gyro_y_OC=0;
gyro_z_OC=0;
Wire.begin();
Wire.beginTransmission(MPU_ADDRESS);// Start transmission with the MPU sensor
Wire.write(PWRMANAGE1); // PWR_MGMT_1 register
Wire.write(0x00);Â Â // set to zero (wakes the sensor up, enables the temperature sensor)
Wire.endTransmission();
}//MPUSetup
void MPUDataScale(void){
AcX = AcX_out/ACSCALE;
AcY = AcY_out/ACSCALE;
AcZ = AcZ_out/ACSCALE;
Tmp = Tmp_out /340.00+36.53; //equation for temperature in degrees C from DataSheet1 page 31 of register description
GyX = GyroX_out/GYSCALE;
GyY = GyroY_out/GYSCALE;
GyZ = GyroZ_out/GYSCALE;
}//MPUDataScale
I'm not copying the whole code .. however I get the same error for all the functions and with all the variables
my first thought is that it's about the way of variables decleration maybe .. still can't get it
Thanks all in advance :))