Libraries \ SmoothInterpolate

Reference for Wiring version 1.0 Build 0100+ If you have a previous version, use the reference included with your software. If see any errors or have any comments, let us know.

Class

SmoothInterpolate

Name

count()

Examples
#include <SmoothInterpolate.h>

void setup() 
{
  Serial.begin(9600);
  
  float arr[2] = { 0.0, 1.0}; //from 0.0 to 1.0
  // you start with 2 values, and you have 21 steps between each value
  SmoothInterpolate< 2 , 21 > smoothInterpolate = arr; 
  smoothInterpolate.calculate(); // smooth interpolate
  
  float prev = 0;
  for (int i=0; i<smoothInterpolate.size(); i++) {
    float smoothed = smoothInterpolate[i]; // access the third value (index 2)
    Serial.print("At ");
    Serial.print(i);
    Serial.print(" value =");
    Serial.print(smoothed);
    Serial.print("tdelta = ");
    Serial.print(smoothed-prev);
    prev = smoothed;
  }
    
}

void loop() 
{

}
Description This method is the same as size(). Get the number of values in the interpolated array.
Syntax
calculate()
Returns The number of vales in the interpolated array.
Usage Application
Updated on July 07, 2011 11:11:34pm PDT

Creative Commons License