summaryrefslogtreecommitdiff
path: root/examples/sinewave/sinewave_example.cpp
diff options
context:
space:
mode:
authormarwik15 <marwik15@gmail.com>2022-05-02 11:30:54 +0200
committermarwik15 <marwik15@gmail.com>2022-05-02 11:30:54 +0200
commitd417394ae791e9972fede0665587aa612f93bca0 (patch)
tree1087d58f9db079327b9f516157a31b6821b7997f /examples/sinewave/sinewave_example.cpp
parentac5e26518a780f19483585cd6b5d62de9094c2b8 (diff)
downloadhwd-d417394ae791e9972fede0665587aa612f93bca0.zip
hwd-d417394ae791e9972fede0665587aa612f93bca0.tar.gz
hwd-d417394ae791e9972fede0665587aa612f93bca0.tar.bz2
Add sine wave generator
Diffstat (limited to 'examples/sinewave/sinewave_example.cpp')
-rw-r--r--examples/sinewave/sinewave_example.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/sinewave/sinewave_example.cpp b/examples/sinewave/sinewave_example.cpp
new file mode 100644
index 0000000..e6583d6
--- /dev/null
+++ b/examples/sinewave/sinewave_example.cpp
@@ -0,0 +1,20 @@
+#include <hwd.h>
+#include <math.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <iostream>
+
+int main() {
+
+ hwd::sinewave::set_amplitude(11);
+ hwd::sinewave::set_frequency(10);
+ hwd::sinewave::set_phase(30);
+
+ for (int i = 1; i < 1200; i++) {
+ std::cout << hwd::sinewave::get_point() << std::endl;
+
+ }
+
+ return 0;
+}