rgb32

Hi. I've been trying to write a sketch to interpolate between points from a table. The stumbling block at the moment is a compiling problem where error message " cannot convert 'int (*)[10]' to 'int*' for argument '5' to 'int multimap2d(int, int, int*, int*, int*)' " you'll see that this relates to an array being passed to function "multimap2d".

I'm running an Uno 3

Can anyone advise a fix to get this running?

Although the numbers in the array are all the same (by column) at this point this is for ease of generating a starting point. Every point could be unique. Likewise the tpsaxis and rpmaxis do need necessarily have regular spacing.

// deal with special cases first if (xval <= xaxis[0]) { xpos = 0 ; xi=0 ; // then no interpolation is required. } else if (xval >= xaxis[9]) { xpos = 9; xi=0; // then no interpolation is required. } else {//search right interval // uint8_t pos = 1; // have already established that we're not at xaxis[0] use xpos=1 while(xval > xaxis[xpos]) xpos++; // search until xpos found // this will handle all exact "points" in the xaxis array if (xval == xaxis[xpos]) { xi=0; // no interpolation is required in x. } else { xi=1; // If above doesn't solve then interpolation is required using xpos and xpos-1 } }// do the same for yaxis

// deal with special cases first if (yval <= yaxis[0]) { ypos = 0; yi=0; // then no interpolation is required. } else if (yval >= yaxis[9]) { ypos = 9; yi=0 ;// then no interpolation is required. } else { //search right interval // have already established that we're not at yaxis[0] use ypos = 1 while(yval > yaxis[ypos]) ypos++; // search until ypos found // this will handle all exact "points" in the _in array if (yval == yaxis[ypos]) { yi=0; // no interpolation is required in y. } else { yi=1; // If above doesn't solve then interpolation is required using ypos and ypos-1 } }

// deal with special cases first if (xval <= xaxis[0]) { xpos = 0 ; xi=0 ; // then no interpolation is required. } else if (xval >= xaxis[9]) { xpos = 9; xi=0; // then no interpolation is required. } else {//search right interval // uint8_t pos = 1; // have already established that we're not at xaxis[0] use xpos=1 while(xval > xaxis[xpos]) xpos++; // search until xpos found // this will handle all exact "points" in the xaxis array if (xval == xaxis[xpos]) { xi=0; // no interpolation is required in x. } else { xi=1; // If above doesn't solve then interpolation is required using xpos and xpos-1 } }// do the same for yaxis

// deal with special cases first if (yval <= yaxis[0]) { ypos = 0; yi=0; // then no interpolation is required. } else if (yval >= yaxis[9]) { ypos = 9; yi=0 ;// then no interpolation is required. } else { //search right interval // have already established that we're not at yaxis[0] use ypos = 1 while(yval > yaxis[ypos]) ypos++; // search until ypos found // this will handle all exact "points" in the _in array if (yval == yaxis[ypos]) { yi=0; // no interpolation is required in y. } else { yi=1; // If above doesn't solve then interpolation is required using ypos and ypos-1 } }

// deal with special cases first if (xval <= xaxis[0]) { xpos = 0 ; xi=0 ; // then no interpolation is required. } else if (xval >= xaxis[9]) { xpos = 9; xi=0; // then no interpolation is required. } else {//search right interval // uint8_t pos = 1; // have already established that we're not at xaxis[0] use xpos=1 while(xval > xaxis[xpos]) xpos++; // search until xpos found // this will handle all exact "points" in the xaxis array if (xval == xaxis[xpos]) { xi=0; // no interpolation is required in x. } else { xi=1; // If above doesn't solve then interpolation is required using xpos and xpos-1 } }// do the same for yaxis

// deal with special cases first if (yval <= yaxis[0]) { ypos = 0; yi=0; // then no interpolation is required. } else if (yval >= yaxis[9]) { ypos = 9; yi=0 ;// then no interpolation is required. } else { //search right interval // have already established that we're not at yaxis[0] use ypos = 1 while(yval > yaxis[ypos]) ypos++; // search until ypos found // this will handle all exact "points" in the _in array if (yval == yaxis[ypos]) { yi=0; // no interpolation is required in y. } else { yi=1; // If above doesn't solve then interpolation is required using ypos and ypos-1 } }

And indeed it proves easy enough. One wrinkle is that I think I have my values typed in back-asswards or confusing the axes, since I'm not getting the right values out: probably reading say cell (3,4) when I should be at (4,3). But I daresay I'll figure that out.

I am doing the same task with a larger array. can anyone tell me why I am not getting the result from from serial monitor. my code is given belowDo I have to use the Flash memory to complete this task. If so how do i retrieve data from Flash memory