Hi All,
I tried adding the spline library GitHub - kerinin/arduino-splines: 1D splines for the arduino environment to my project and it doesn't want to compile.
The first error I got was undefined ref to WProgram.h, which I changed to Arduino.h in the cpp and h files.
I am just trying to compile the example pde
#include <spline.h>
Spline tempCurve;
void setup(void) {
Serial.begin(9600);
double x[7] = {-1,0,1,2,3,4, 5};
double y[7] = { 0,0,8,5,2,10,10};
tempCurve.setPoints(x,y,7);
tempCurve.setDegree( Catmull );
for( float i = 0; i <= 4; i+= .1 ) {
float temp = tempCurve.value(i);
Serial.print(i);
for(float j=0; j<= temp; j += .2) {
Serial.print( "*" );
}
Serial.print( " " );
Serial.println(temp);
}
}
void loop(void) {
}
But now I try to compile and get: "no matching function for call to Spline..."
sketch_mar31a.cpp: In function 'void setup()':
sketch_mar31a:9: error: no matching function for call to 'Spline::setPoints(double [7], double [7], int)'
C:\Users\Public\Documents\arduino-1.0\libraries\spline/spline.h:21: note: candidates are: void Spline::setPoints(float*, float*, int)
C:\Users\Public\Documents\arduino-1.0\libraries\spline/spline.h:22: note: void Spline::setPoints(float*, float*, float*, int)
What can I do to get this library working?
Thanks in advance!