Hi I am trying to write a functiont that will build a 2x4 array based on 2 1x4 arrays.
the two relevant functions are below. The first function gets information from some sensors and outputs it (I think) as a 1x4 array.
The second function is the problem and I have attached the error messages.
{
double quatCalib_mat[2][4];
double quatCalib_ABC[4];
double quatCalib_GHI[4];
double get_quat(Adafruit_BNO055 ref, double quatArray[])
{
imu::Quaternion quat2 = ref.getQuat();
quatArray[0]= quat2.w();
quatArray[1]= quat2.x();
quatArray[2]= quat2.y();
quatArray[3] =quat2.z();
}
void Calibrate()
{
quatCalib_ABC=get_quat(bnoABC, quatCalib_ABC);
quatCalib_GHI=get_quat(bnoGHI, quatCalib_GHI);
quatCalib_mat= {
{quatCalib_ABC},
{quatCalib_GHI}
};
}
the error messages
Arduino: 1.6.9 (Windows 7), Board: "Arduino/Genuino Uno"
E:\UNI2016\thesis\gizmo programming\Thesis_V3_M\Thesis_V3_M.ino: In function 'void Calibrate()':
Thesis_V3_M:101: error: incompatible types in assignment of 'double' to 'double [4]'
quatCalib_ABC=get_quat(bnoABC, quatCalib_ABC);
^
Thesis_V3_M:103: error: incompatible types in assignment of 'double' to 'double [4]'
quatCalib_GHI=get_quat(bnoGHI, quatCalib_GHI);
^
Thesis_V3_M:105: error: assigning to an array from an initializer list
quatCalib_mat= {
^
exit status 1
incompatible types in assignment of 'double' to 'double [4]'
Cheers
Alex