I have a big program I'm slightly adapting from someone else, so I won't post it all here, but I can show what my issue is.
I initialize a 2D array like this:
double Steps[][5] = {
{1,3.555,1,1,76},
{2,3.675,0,1,76},
{3,7,0,0,0},
{4,2.755,1,1,83},
{5,2.295,1,0,83},
{6,2.875,0,0,83},
{7,2.295,0,1,83},
{8,1.410,0,1,90},
{9,1.410,1,1,90}
};
If I then do this:
Serial.println(Steps[0,0]);
Serial.println(Steps[0,1]);
Serial.println(Steps[0,2]);
Serial.println(Steps[0,3]);
Serial.println(Steps[0,4]);
it won't compile and gives the below error:
error: no matching function for call to 'println(double [5])'
Serial.println(Steps[0,0]);
If I do this:
Serial.println(*Steps[0,0]);
Serial.println(*Steps[0,1]);
Serial.println(*Steps[0,2]);
Serial.println(*Steps[0,3]);
Serial.println(*Steps[0,4]);
It compiles and prints
1.0
2.0
3.0
4.0
5.0
Which I can only assume is related to the array position in some way.
I have read up on pointer, arrays, referencing and dereferencing, but I still don't follow why this does what it does.
Can someone point me in the right direction here?
Thanks