Source

ArduinoProjects / Libraries / Animation / Animation.h

#define MAX_NUM_ANIM_VALUES 8

//My animated servo
class Animation
{
public:
  enum AnimMode
  {
    AnimMode_Wrap,
    AnimMode_PingPong,
  };

	Animation(float* valueArray, int numValues, AnimMode mode, float animTime);
  
	void SetValues(float* valueArray, int numValues);
	float CalcAnimVal();
	
	void Update(float timeDelta);
	
	float currT;
	float totalAnimTime;
	float animSpeed;
	float animDir;

	float animValues[MAX_NUM_ANIM_VALUES];
	int numAnimValues;
  
  AnimMode animMode;
	
private:

};