diff options
author | Anthony Wang | 2022-01-15 21:16:30 -0600 |
---|---|---|
committer | Anthony Wang | 2022-01-15 21:16:30 -0600 |
commit | 257e0247c614600865d861a0b818f39146a89744 (patch) | |
tree | bb41de894fced7d6d171046c384fd5ab1718fb32 /libraries/arduinoCurveFitting-master/examples/fitCurve/fitCurve.ino | |
parent | f79df9410b6e356c3e371cd127ed6bfe64d95f18 (diff) |
Delete old stuff
Diffstat (limited to 'libraries/arduinoCurveFitting-master/examples/fitCurve/fitCurve.ino')
-rw-r--r-- | libraries/arduinoCurveFitting-master/examples/fitCurve/fitCurve.ino | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/libraries/arduinoCurveFitting-master/examples/fitCurve/fitCurve.ino b/libraries/arduinoCurveFitting-master/examples/fitCurve/fitCurve.ino deleted file mode 100644 index cbc8966..0000000 --- a/libraries/arduinoCurveFitting-master/examples/fitCurve/fitCurve.ino +++ /dev/null @@ -1,37 +0,0 @@ -#include <curveFitting.h> - -void setup(){ - Serial.begin(9600); - while(!Serial); - Serial.println("Starting"); - - char buf[100]; - int xpower = 3; - int order = 3; - snprintf(buf, 100, "Fitting curve of order %i to data of power %i...\n", order, xpower); - Serial.print(buf); - - double x[26]; - double t[26]; - for (int i = 0; i < sizeof(x)/sizeof(double); i++){ - t[i] = i; - x[i] = pow(i, xpower); - } - - double coeffs[order+1]; - int ret = fitCurve(order, sizeof(x)/sizeof(double), t, x, sizeof(coeffs)/sizeof(double), coeffs); - - if (ret == 0){ //Returned value is 0 if no error - uint8_t c = 'a'; - Serial.println("Coefficients are"); - for (int i = 0; i < sizeof(coeffs)/sizeof(double); i++){ - snprintf(buf, 100, "%c=",c++); - Serial.print(buf); - Serial.print(coeffs[i]); - Serial.print('\t'); - } - } -} - -void loop(){ -} |