I'm trying to make a pointer to a multidimensional array. Any idea how to do that?
In my old post I already found out how to do that with one array.
http://arduino.cc/forum/index.php/topic,53807.0.html
My code.
int _rybWheel[25][3] =
{ { 0 , 255, 255 }, // 0
{ 12 , 255, 255 }, // 15
{ 24 , 255, 255 }, // 30
{ 30 , 255, 255 }, // 45
{ 36 , 255, 255 }, // 60
{ 42 , 255, 255 }, // 75
{ 48 , 255, 255 }, // 90
{ 54 , 255, 255 }, // 105
{ 60 , 255, 255 }, // 120
{ 72 , 255, 255 }, // 135
{ 84 , 255, 255 }, // 150
{ 108, 255, 255 }, // 165
{ 120, 255, 255 }, // 180
{ 154, 255, 255 }, // 195
{ 180, 255, 255 }, // 210
{ 206, 255, 255 }, // 225
{ 225, 255, 255 }, // 240
{ 240, 255, 255 }, // 255
{ 260, 255, 255 }, // 270
{ 265, 255, 255 }, // 285
{ 280, 255, 255 }, // 300
{ 300, 255, 255 }, // 315
{ 315, 255, 255 }, // 330
{ 333, 255, 255 }, // 345
{ 360, 255, 255 } // 360
};
I declare the array in the .h file like this:
int* rybWheel;
And in the constructor I write.
rybWheel = _rybWheel;
And I do this in a function (thats the error on line 360)
Serial.println(rybWheel[rybWheelIndex+1][0],DEC);
I get these errors:
/Users/macbook/Dropbox/code/_arduino/libraries/ColorLight/ColorLight.cpp: In constructor 'ColourPalette::ColourPalette()':
/Users/macbook/Dropbox/code/_arduino/libraries/ColorLight/ColorLight.cpp:55: error: cannot convert 'int [25][3]' to 'int*' in assignment
/Users/macbook/Dropbox/code/_arduino/libraries/ColorLight/ColorLight.cpp: In member function 'void ColourPalette::ColourAtRYBWheel(int, int*)':
/Users/macbook/Dropbox/code/_arduino/libraries/ColorLight/ColorLight.cpp:360: error: invalid types 'int[int]' for array subscript
I've looked up some information on pointers, but I cannot find clear information about pointers to multidimensional arrays and how I can use that with Arduino.