#include "MPU6050.h"
class DATA{
public:
DATA(int A);
void Sensor();
}
DATA::DATA(int A){
MPU6050 mpu(A);
}
void Sensor(){
mpu.setFullScaleAccelRange(3);
// the problem is here, "mpu" object is not declared for this friend function
}
int main(){
DATA mpu1(0x68)
/* I'm using two MPU6050 on I2C bus so I need to address them.
this example contains only one MPU6050 object*/
return 0;
}
Compiler Error : "mpu was not declared in this scope"
While writing this code I had a feeling that the mpu object is not declared for Sensor friend function.
Is there a way to deal with this case?
I'm a C++ Beginner.
Thanks