forked from addacsystem/ADDAC-Library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathADDAC_SuperFormula.h
executable file
·84 lines (61 loc) · 1.62 KB
/
ADDAC_SuperFormula.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* ADDAC_SuperFormula
*
*
*
* in Arduino environment simply add at the very top:
#include <ADDAC_SuperFormula.h> // This loads the Class when compiling
ADDAC_SuperFormula SuperFormula; // This Instantiates 1 Class with the name "SuperFormula"
*
*/
#ifndef ADDAC_SuperFormula_h
#define ADDAC_SuperFormula_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#include <StandardCplusplus.h>
#include <vector>
#include <ADDAC_Timer.h>
//max and min values checked on processing if n1 value set to 50
#define minValueX -1.6999406
#define maxValueX 1.6999398
#define minValueY -1.6999372
#define maxValueY 1.6999389
class ADDAC_SuperFormula{
public:
ADDAC_SuperFormula();
void update(float m, float n2, float n3, long _time);
void superformulaPoint(float m, float n2, float n3, float phi);
float mapfloat(float x, float in_min, float in_max, float out_min, float out_max);
float getX();
float getY();
void setLoopMin(int _min);
void setLoopMax(int _max);
void setPingPongMode(bool _mirror);
bool mirror;
bool startUp;
float oldValue;
float pX;
float pY;
float oldX;
float oldY;
float x;
float y;
float interpolationX;
float interpolationY;
int pos;
int inc;
int oldPos;
int numPoints;
int loopMin;
float CPUtime();
long cpuTime[10];
long actualTime;
int cpuPos;
long metroTime;
ADDAC_Timer metro;
ADDAC_Timer metro2;
};
#endif