-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathfunctionGeneratorDuoPlot.ino
More file actions
53 lines (41 loc) · 970 Bytes
/
functionGeneratorDuoPlot.ino
File metadata and controls
53 lines (41 loc) · 970 Bytes
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
//
// FILE: functionGeneratorDuoPlot.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo function generators
// DATE: 2020-06-10
// URL: https://github.com/RobTillaart/FunctionGenerator
//
// use a Serial plotter to show the data
#include "functionGenerator.h"
funcgen gen1;
funcgen gen2;
void setup()
{
Serial.begin(115200);
// Serial.println();
// Serial.println(__FILE__);
// Serial.println("FUNCTIONGENERATOR_LIB_VERSION: ");
// Serial.println(FUNCTIONGENERATOR_LIB_VERSION);
// Serial.println();
gen1.setFrequency(13);
gen1.setAmplitude(50);
gen1.setPhase(0);
gen1.setYShift(0);
gen2.setFrequency(17);
gen2.setAmplitude(25);
gen2.setPhase(0.25);
gen2.setYShift(25);
}
void loop()
{
float t = millis() * 0.001;
float x = gen1.sinus(t);
float y = gen2.sinus(t);
Serial.print(x);
Serial.print("\t");
Serial.print(y);
Serial.print("\t");
Serial.print(x + y);
Serial.println();
}
// -- END OF FILE --