commit 01d85538bb52bbe6416efd54097e2720ad557144 Author: Cynopolis Date: Sun Oct 10 11:39:32 2021 -0500 Initial commit diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..89cc49c --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.pio +.vscode/.browse.c_cpp.db* +.vscode/c_cpp_properties.json +.vscode/launch.json +.vscode/ipch diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..e80666b --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ] +} diff --git a/LiquidCrystal_I2C-master.zip b/LiquidCrystal_I2C-master.zip new file mode 100644 index 0000000..81ae275 Binary files /dev/null and b/LiquidCrystal_I2C-master.zip differ diff --git a/Sample_Waveform.awv b/Sample_Waveform.awv new file mode 100644 index 0000000..59d2a7d --- /dev/null +++ b/Sample_Waveform.awv @@ -0,0 +1,600 @@ +-1 2047 +-1 2047 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2042 +-1 2036 +-1 2036 +-1 2036 +2036 2504 +2527 2785 +-1 2797 +2808 3089 +3112 3370 +-1 3399 +3428 3487 +-1 3510 +-1 3533 +3592 3873 +-1 3873 +-1 3873 +3873 3838 +-1 3838 +3838 3779 +3767 3744 +-1 3744 +-1 3744 +-1 3732 +3732 3721 +-1 3715 +3709 3697 +-1 3697 +-1 3697 +-1 3674 +-1 3674 +-1 3674 +-1 3662 +-1 3662 +3662 3650 +-1 3650 +-1 3639 +-1 3627 +-1 3627 +3615 3604 +-1 3592 +3592 3580 +-1 3580 +-1 3580 +-1 3557 +3545 3533 +-1 3528 +-1 3522 +3522 3510 +-1 3498 +-1 3487 +3487 3475 +-1 3463 +-1 3463 +-1 3463 +-1 3452 +-1 3452 +-1 3446 +-1 3440 +-1 3440 +-1 3440 +-1 3428 +-1 3416 +-1 3416 +-1 3416 +-1 3416 +-1 3416 +-1 3405 +-1 3405 +-1 3405 +-1 3393 +-1 3393 +-1 3387 +-1 3381 +-1 3381 +-1 3381 +-1 3381 +-1 3370 +-1 3370 +-1 3370 +-1 3346 +-1 3346 +-1 3346 +-1 3346 +-1 3346 +-1 3346 +-1 3346 +-1 3335 +-1 3335 +-1 3335 +-1 3335 +-1 3335 +-1 3335 +-1 3335 +-1 3323 +-1 3323 +-1 3323 +-1 3323 +-1 3323 +-1 3323 +-1 3323 +-1 3323 +-1 3323 +-1 3323 +-1 3323 +-1 3323 +-1 3311 +-1 3311 +-1 3311 +3311 2363 +2352 2317 +2305 2200 +2200 2165 +2165 2141 +2141 2083 +2071 2024 +-1 2024 +-1 2024 +-1 2024 +2024 2036 +2048 2059 +-1 2059 +-1 2059 +-1 2071 +2071 2083 +-1 2083 +-1 2083 +-1 2083 +-1 2083 +-1 2083 +-1 2083 +-1 2083 +-1 2083 +-1 2083 +2083 2071 +2071 1778 +1755 1708 +1673 1591 +-1 1568 +1544 1030 +995 948 +924 831 +807 644 +-1 644 +-1 644 +-1 644 +-1 644 +-1 644 +644 655 +667 702 +702 714 +-1 725 +-1 733 +-1 741 +-1 749 +-1 761 +-1 772 +-1 784 +-1 784 +-1 784 +-1 784 +-1 784 +-1 784 +784 807 +-1 807 +-1 819 +-1 831 +831 842 +-1 848 +-1 854 +-1 860 +-1 866 +-1 866 +-1 878 +-1 890 +901 913 +-1 924 +-1 936 +-1 948 +-1 956 +-1 963 +-1 971 +-1 971 +-1 971 +-1 971 +-1 983 +-1 995 +-1 1006 +-1 1010 +-1 1014 +-1 1018 +-1 1018 +-1 1018 +-1 1022 +-1 1026 +-1 1030 +-1 1030 +-1 1041 +-1 1041 +-1 1041 +-1 1049 +-1 1057 +-1 1065 +-1 1071 +-1 1076 +-1 1080 +-1 1084 +-1 1088 +-1 1088 +-1 1088 +-1 1090 +-1 1093 +-1 1095 +-1 1098 +-1 1100 +-1 1100 +-1 1100 +-1 1100 +-1 1100 +-1 1100 +-1 1100 +-1 1100 +-1 1100 +-1 1100 +-1 1100 +-1 1100 +-1 1100 +-1 1100 +-1 1100 +-1 1100 +-1 1100 +1100 1170 +-1 1205 +1252 1287 +1322 1427 +1463 1697 +1732 2071 +-1 2071 +-1 2071 +-1 2071 +-1 2071 +-1 2071 +-1 2071 +-1 2070 +-1 2070 +-1 2070 +-1 2070 +-1 2070 +-1 2070 +-1 2070 +-1 2070 +-1 2070 +-1 2070 +-1 2070 +-1 2070 +-1 2070 +-1 2069 +-1 2069 +-1 2069 +-1 2069 +-1 2069 +-1 2069 +-1 2069 +-1 2069 +-1 2069 +-1 2069 +-1 2069 +-1 2069 +-1 2069 +-1 2068 +-1 2068 +-1 2068 +-1 2068 +-1 2068 +-1 2068 +-1 2068 +-1 2068 +-1 2068 +-1 2068 +-1 2068 +-1 2068 +-1 2068 +-1 2067 +-1 2067 +-1 2067 +-1 2067 +-1 2067 +-1 2067 +-1 2067 +-1 2067 +-1 2067 +-1 2067 +-1 2067 +-1 2067 +-1 2067 +-1 2066 +-1 2066 +-1 2066 +-1 2066 +-1 2066 +-1 2066 +-1 2066 +-1 2066 +-1 2066 +-1 2066 +-1 2066 +-1 2066 +-1 2066 +-1 2065 +-1 2065 +-1 2065 +-1 2065 +-1 2065 +-1 2065 +-1 2065 +-1 2065 +-1 2065 +-1 2065 +-1 2065 +-1 2065 +-1 2065 +-1 2065 +-1 2064 +-1 2064 +-1 2064 +-1 2064 +-1 2064 +-1 2064 +-1 2064 +-1 2064 +-1 2064 +-1 2064 +-1 2064 +-1 2064 +-1 2064 +-1 2063 +-1 2063 +-1 2063 +-1 2063 +-1 2063 +-1 2063 +-1 2063 +-1 2063 +-1 2063 +-1 2063 +-1 2063 +-1 2063 +-1 2063 +-1 2062 +-1 2062 +-1 2062 +-1 2062 +-1 2062 +-1 2062 +-1 2062 +-1 2062 +-1 2062 +-1 2062 +-1 2062 +-1 2062 +-1 2062 +-1 2061 +-1 2061 +-1 2061 +-1 2061 +-1 2061 +-1 2061 +-1 2061 +-1 2061 +-1 2061 +-1 2061 +-1 2061 +-1 2061 +-1 2061 +-1 2060 +-1 2060 +-1 2060 +-1 2060 +-1 2060 +-1 2060 +-1 2060 +-1 2060 +-1 2060 +-1 2060 +-1 2060 +-1 2060 +-1 2060 +-1 2059 +-1 2059 +-1 2059 +-1 2059 +-1 2059 +-1 2059 +-1 2059 +-1 2059 +-1 2059 +-1 2059 +-1 2059 +-1 2059 +-1 2059 +-1 2058 +-1 2058 +-1 2058 +-1 2058 +-1 2058 +-1 2058 +-1 2058 +-1 2058 +-1 2058 +-1 2058 +-1 2058 +-1 2058 +-1 2058 +-1 2057 +-1 2057 +-1 2057 +-1 2057 +-1 2057 +-1 2057 +-1 2057 +-1 2057 +-1 2057 +-1 2057 +-1 2057 +-1 2057 +-1 2057 +-1 2056 +-1 2056 +-1 2056 +-1 2056 +-1 2056 +-1 2056 +-1 2056 +-1 2056 +-1 2056 +-1 2056 +-1 2056 +-1 2056 +-1 2056 +-1 2055 +-1 2055 +-1 2055 +-1 2055 +-1 2055 +-1 2055 +-1 2055 +-1 2055 +-1 2055 +-1 2055 +-1 2055 +-1 2055 +-1 2055 +-1 2054 +-1 2054 +-1 2054 +-1 2054 +-1 2054 +-1 2054 +-1 2054 +-1 2054 +-1 2054 +-1 2054 +-1 2054 +-1 2054 +-1 2054 +-1 2054 +-1 2053 +-1 2053 +-1 2053 +-1 2053 +-1 2053 +-1 2053 +-1 2053 +-1 2053 +-1 2053 +-1 2053 +-1 2053 +-1 2053 +-1 2053 +-1 2052 +-1 2052 +-1 2052 +-1 2052 +-1 2052 +-1 2052 +-1 2052 +-1 2052 +-1 2052 +-1 2052 +-1 2052 +-1 2052 +-1 2052 +-1 2051 +-1 2051 +-1 2051 +-1 2051 +-1 2051 +-1 2051 +-1 2051 +-1 2051 +-1 2051 +-1 2051 +-1 2051 +-1 2051 +-1 2051 +-1 2050 +-1 2050 +-1 2050 +-1 2050 +-1 2050 +-1 2050 +-1 2050 +-1 2050 +-1 2050 +-1 2050 +-1 2050 +-1 2050 +-1 2050 +-1 2049 +-1 2049 +-1 2049 +-1 2049 +-1 2049 +-1 2049 +-1 2049 +-1 2049 +-1 2049 +-1 2049 +-1 2049 +-1 2049 +-1 2049 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2048 +-1 2047 +-1 2047 +-1 2047 +-1 2047 +-1 2047 +-1 2047 diff --git a/Sample_Waveform2.awv b/Sample_Waveform2.awv new file mode 100644 index 0000000..1a0dd60 --- /dev/null +++ b/Sample_Waveform2.awv @@ -0,0 +1,600 @@ +4095 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 4001 +-1 3998 +-1 3996 +-1 3993 +-1 3990 +-1 3990 +-1 3990 +-1 3990 +-1 3990 +-1 3990 +-1 3990 +-1 3990 +-1 3990 +-1 3990 +-1 3990 +-1 3990 +-1 3990 +-1 3990 +-1 3990 +-1 3990 +-1 3984 +-1 3978 +-1 3972 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3966 +-1 3978 +-1 3978 +-1 3978 +-1 3978 +-1 3978 +-1 3978 +-1 3978 +-1 3978 +-1 3978 +-1 3978 +-1 3978 +-1 3978 +-1 3978 +-1 3978 +-1 3978 +-1 3978 +-1 3978 +-1 3978 +-1 3978 +-1 3978 +3978 2937 +-1 2898 +-1 2859 +-1 2820 +-1 2762 +2703 2328 +2282 2048 +2012 1603 +-1 1591 +-1 1568 +-1 1545 +-1 1521 +-1 1463 +-1 1404 +1310 23 +-1 35 +-1 47 +-1 59 +-1 70 +-1 70 +-1 70 +-1 70 +-1 82 +-1 82 +-1 82 +-1 86 +-1 90 +-1 94 +-1 98 +-1 102 +-1 106 +-1 109 +-1 113 +-1 117 +-1 117 +-1 117 +-1 117 +-1 117 +-1 117 +-1 117 +-1 117 +-1 117 +-1 117 +-1 117 +-1 117 +-1 117 +-1 117 +-1 117 +117 105 +-1 105 +-1 105 +-1 105 +-1 105 +-1 105 +-1 105 +-1 105 +-1 105 +-1 94 +-1 82 +-1 70 +-1 66 +-1 63 +-1 59 +-1 53 +-1 47 +-1 47 +-1 39 +-1 31 +-1 23 +-1 23 +-1 23 +-1 23 +-1 23 +-1 23 +-1 23 +-1 23 +-1 23 +-1 23 +-1 23 +-1 23 +-1 23 +-1 23 +-1 35 +-1 40 +-1 45 +-1 49 +-1 54 +-1 59 +-1 62 +-1 65 +-1 67 +-1 70 +-1 70 +-1 70 +-1 70 +-1 70 +-1 70 +-1 70 +-1 70 +-1 70 +-1 70 +-1 70 +-1 70 +-1 70 +-1 70 +-1 70 +-1 70 +70 94 +117 363 +433 468 +-1 503 +-1 538 +-1 573 +-1 608 +690 959 +1076 1229 +-1 1264 +-1 1307 +-1 1349 +-1 1392 +1486 2387 +2469 3323 +3381 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4068 +-1 4040 +-1 4013 +-1 3987 +-1 3961 +-1 3936 +-1 3910 +-1 3884 +-1 3849 +-1 3814 +-1 3779 +-1 3727 +3674 3522 +3452 3370 +3299 2048 +-1 1837 +1743 1638 +1556 1451 +-1 1369 +-1 1287 +-1 1240 +1193 690 +-1 632 +608 538 +-1 491 +-1 468 +-1 445 +-1 406 +-1 367 +-1 328 +246 105 +59 47 +23 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +23 59 +-1 94 +-1 134 +-1 174 +-1 214 +-1 254 +-1 294 +-1 334 +-1 374 +-1 404 +433 1252 +-1 1299 +-1 1346 +-1 1410 +1474 1755 +-1 1790 +1825 2375 +-1 2469 +-1 2527 +-1 2568 +-1 2609 +-1 2761 +2843 3709 +-1 3767 +-1 3832 +-1 3896 +-1 3949 +4001 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 diff --git a/Waveform Converter.xlsx b/Waveform Converter.xlsx new file mode 100644 index 0000000..762943d Binary files /dev/null and b/Waveform Converter.xlsx differ diff --git a/include/README b/include/README new file mode 100644 index 0000000..194dcd4 --- /dev/null +++ b/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/lib/README b/lib/README new file mode 100644 index 0000000..6debab1 --- /dev/null +++ b/lib/README @@ -0,0 +1,46 @@ + +This directory is intended for project specific (private) libraries. +PlatformIO will compile them to static libraries and link into executable file. + +The source code of each library should be placed in a an own separate directory +("lib/your_library_name/[here are source files]"). + +For example, see a structure of the following two libraries `Foo` and `Bar`: + +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- README --> THIS FILE +| +|- platformio.ini +|--src + |- main.c + +and a contents of `src/main.c`: +``` +#include +#include + +int main (void) +{ + ... +} + +``` + +PlatformIO Library Dependency Finder will find automatically dependent +libraries scanning project source files. + +More information about PlatformIO Library Dependency Finder +- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/platformio.ini b/platformio.ini new file mode 100644 index 0000000..f0aadad --- /dev/null +++ b/platformio.ini @@ -0,0 +1,18 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:due] +platform = atmelsam +board = due +framework = arduino +monitor_speed = 115200 +lib_deps = + paulstoffregen/Encoder@^1.4.1 + C:\Users\Quinn\.platformio\lib\LiquidCrystal_I2C diff --git a/sinewave_waveform.awv b/sinewave_waveform.awv new file mode 100644 index 0000000..ef32bac --- /dev/null +++ b/sinewave_waveform.awv @@ -0,0 +1,600 @@ +2188 2083 +-1 2075 +-1 2067 +-1 2059 +-1 2071 +-1 2086 +-1 2100 +-1 2115 +-1 2129 +-1 2135 +-1 2141 +-1 2147 +-1 2153 +-1 2176 +-1 2176 +-1 2176 +-1 2176 +-1 2188 +-1 2201 +-1 2215 +-1 2228 +-1 2242 +-1 2255 +-1 2269 +-1 2282 +-1 2294 +-1 2305 +2317 2340 +-1 2352 +-1 2363 +-1 2376 +-1 2389 +-1 2401 +-1 2414 +-1 2427 +-1 2440 +-1 2453 +-1 2466 +-1 2478 +-1 2491 +-1 2504 +-1 2522 +-1 2539 +-1 2557 +-1 2574 +-1 2586 +-1 2597 +-1 2609 +-1 2621 +-1 2633 +-1 2644 +-1 2656 +-1 2668 +-1 2679 +-1 2691 +-1 2703 +-1 2714 +-1 2726 +-1 2738 +-1 2749 +-1 2761 +-1 2777 +-1 2792 +-1 2808 +-1 2820 +-1 2831 +-1 2843 +-1 2855 +-1 2867 +-1 2878 +-1 2890 +-1 2902 +2937 2960 +-1 2972 +-1 2984 +-1 2996 +-1 3007 +-1 3019 +-1 3030 +-1 3042 +-1 3053 +-1 3065 +-1 3078 +-1 3092 +-1 3105 +-1 3118 +-1 3131 +-1 3145 +-1 3158 +-1 3171 +-1 3181 +-1 3192 +-1 3202 +-1 3212 +-1 3223 +-1 3233 +-1 3243 +-1 3254 +-1 3264 +3276 3288 +-1 3294 +-1 3299 +-1 3314 +-1 3329 +-1 3343 +-1 3358 +-1 3364 +-1 3370 +-1 3393 +-1 3405 +-1 3417 +-1 3428 +-1 3440 +-1 3440 +-1 3452 +-1 3463 +-1 3463 +-1 3463 +-1 3463 +-1 3472 +-1 3481 +-1 3489 +-1 3498 +-1 3498 +-1 3498 +-1 3498 +-1 3498 +-1 3498 +-1 3510 +-1 3522 +-1 3522 +-1 3522 +-1 3522 +-1 3522 +-1 3522 +-1 3522 +-1 3522 +-1 3522 +-1 3522 +-1 3522 +-1 3522 +-1 3522 +-1 3522 +-1 3522 +-1 3522 +-1 3522 +-1 3522 +-1 3522 +-1 3522 +-1 3516 +-1 3510 +-1 3510 +3510 3498 +-1 3493 +-1 3487 +-1 3475 +-1 3471 +-1 3467 +-1 3463 +-1 3451 +-1 3440 +-1 3428 +-1 3416 +-1 3408 +-1 3401 +3393 3358 +-1 3346 +-1 3323 +3311 3288 +-1 3276 +-1 3253 +-1 3229 +-1 3218 +-1 3195 +-1 3171 +-1 3148 +-1 3124 +-1 3083 +-1 3042 +-1 3025 +-1 3007 +-1 2978 +-1 2948 +-1 2931 +-1 2913 +-1 2872 +-1 2831 +2785 2750 +2703 2668 +-1 2645 +-1 2621 +-1 2586 +-1 2551 +-1 2480 +-1 2445 +2410 2328 +-1 2270 +-1 2247 +-1 2223 +-1 2184 +-1 2145 +2106 1989 +-1 1954 +-1 1931 +1919 1872 +-1 1866 +-1 1860 +-1 1849 +-1 1837 +-1 1802 +-1 1785 +-1 1767 +-1 1747 +-1 1728 +-1 1708 +-1 1673 +-1 1650 +-1 1626 +-1 1609 +-1 1591 +-1 1568 +-1 1533 +-1 1521 +-1 1474 +-1 1462 +-1 1451 +-1 1439 +-1 1381 +-1 1346 +-1 1310 +-1 1264 +-1 1229 +-1 1205 +-1 1176 +-1 1147 +-1 1135 +-1 1112 +-1 1088 +-1 1077 +-1 1065 +-1 1048 +-1 1030 +-1 983 +-1 966 +-1 948 +-1 928 +-1 909 +-1 889 +-1 866 +-1 849 +-1 831 +-1 819 +-1 808 +-1 796 +-1 784 +-1 761 +-1 749 +725 714 +-1 702 +-1 691 +-1 679 +-1 667 +-1 655 +-1 650 +-1 644 +-1 626 +-1 608 +-1 597 +-1 591 +-1 585 +-1 574 +-1 562 +-1 550 +-1 539 +527 503 +-1 492 +-1 480 +-1 468 +-1 456 +-1 445 +-1 433 +-1 433 +-1 433 +-1 433 +-1 433 +-1 421 +-1 421 +-1 418 +-1 416 +-1 413 +-1 410 +-1 410 +-1 410 +-1 410 +-1 407 +-1 404 +-1 401 +-1 398 +-1 398 +-1 398 +-1 398 +-1 398 +-1 398 +-1 398 +-1 398 +-1 398 +-1 398 +-1 398 +-1 404 +-1 410 +-1 415 +-1 421 +-1 425 +-1 429 +-1 433 +-1 439 +-1 445 +-1 451 +-1 456 +-1 458 +-1 461 +-1 463 +-1 466 +-1 468 +-1 476 +-1 483 +-1 491 +-1 496 +-1 501 +-1 505 +-1 510 +-1 515 +-1 523 +-1 530 +-1 538 +-1 544 +-1 550 +-1 556 +-1 562 +-1 574 +-1 585 +-1 587 +-1 590 +-1 592 +-1 595 +-1 597 +-1 609 +-1 620 +-1 623 +-1 626 +-1 629 +-1 632 +-1 638 +-1 644 +-1 644 +-1 655 +-1 661 +-1 667 +-1 673 +-1 679 +-1 687 +-1 694 +-1 702 +-1 720 +-1 737 +-1 755 +-1 772 +-1 796 +-1 819 +-1 843 +-1 866 +-1 892 +-1 919 +-1 945 +-1 971 +995 1030 +-1 1053 +1088 1123 +-1 1147 +-1 1178 +-1 1209 +-1 1240 +-1 1310 +-1 1345 +-1 1381 +-1 1416 +-1 1445 +-1 1474 +-1 1509 +-1 1544 +1568 1580 +-1 1603 +-1 1619 +-1 1634 +-1 1650 +-1 1685 +-1 1720 +-1 1767 +1825 1872 +-1 1884 +-1 1895 +-1 1907 +1919 1942 +-1 1954 +-1 1966 +-1 2012 +-1 2030 +-1 2048 +2094 2129 +-1 2188 +2211 2258 +2282 2293 +2340 2352 +2399 2434 +-1 2463 +-1 2492 +2539 2609 +-1 2656 +2714 2726 +-1 2734 +-1 2742 +-1 2750 +2785 2820 +-1 2837 +-1 2854 +-1 2871 +-1 2888 +-1 2904 +-1 2921 +-1 2938 +-1 2955 +-1 2972 +-1 2996 +-1 3019 +-1 3048 +-1 3077 +-1 3083 +-1 3089 +-1 3101 +3136 3147 +-1 3159 +-1 3171 +-1 3183 +3194 3218 +-1 3230 +-1 3241 +3264 3288 +-1 3311 +-1 3319 +-1 3327 +-1 3335 +-1 3381 +-1 3399 +-1 3416 +-1 3440 +-1 3452 +-1 3463 +-1 3463 +-1 3463 +-1 3475 +-1 3475 +-1 3475 +-1 3487 +-1 3491 +-1 3494 +-1 3498 +-1 3498 +-1 3498 +-1 3498 +-1 3498 +-1 3498 +-1 3498 +-1 3498 +-1 3502 +-1 3506 +-1 3510 +-1 3510 +-1 3510 +-1 3510 +-1 3510 +-1 3510 +-1 3510 +-1 3510 +-1 3510 +-1 3510 +-1 3510 +-1 3510 +-1 3510 +-1 3510 +-1 3487 +-1 3487 +-1 3485 +-1 3482 +-1 3480 +-1 3477 +-1 3475 +-1 3463 +-1 3459 +-1 3456 +-1 3452 +-1 3446 +-1 3440 +-1 3432 +-1 3424 +-1 3416 +-1 3411 +-1 3405 +-1 3399 +-1 3393 +-1 3370 +-1 3346 +-1 3342 +-1 3339 +-1 3335 +-1 3323 +-1 3311 +-1 3299 +-1 3299 +-1 3299 +-1 3264 +-1 3259 +-1 3253 +-1 3247 +-1 3241 +-1 3235 +-1 3229 +-1 3218 +-1 3206 +-1 3200 +-1 3194 +-1 3188 +-1 3182 +-1 3177 +-1 3171 +-1 3163 +-1 3155 +-1 3147 +-1 3136 +3124 3112 +-1 3101 +-1 3089 +-1 3074 +-1 3060 +-1 3045 +-1 3030 +-1 2995 +-1 2990 +-1 2984 +-1 2972 +-1 2960 +-1 2948 +-1 2925 +-1 2919 +-1 2913 +-1 2890 +-1 2885 +-1 2881 +-1 2876 +-1 2872 +-1 2867 +-1 2861 +-1 2855 +-1 2831 +-1 2820 +-1 2808 +-1 2802 +-1 2796 +-1 2787 +-1 2779 +-1 2770 +-1 2761 +-1 2745 +-1 2730 +2714 2691 +-1 2679 +-1 2656 +-1 2650 +2644 2597 +-1 2574 +-1 2551 +-1 2528 +2504 2399 +-1 2393 +-1 2387 +-1 2375 +-1 2363 +-1 2352 +-1 2340 +-1 2328 +-1 2305 +-1 2282 +-1 2278 +-1 2274 +-1 2270 +-1 2258 +-1 2247 +-1 2235 +-1 2223 +-1 2212 +-1 2200 diff --git a/squarewave_waveform.awv b/squarewave_waveform.awv new file mode 100644 index 0000000..dabda27 --- /dev/null +++ b/squarewave_waveform.awv @@ -0,0 +1,600 @@ +2083 2083 +-1 2090 +-1 2097 +-1 2104 +-1 2111 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2118 +-1 2120 +-1 2122 +-1 2125 +-1 2127 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2129 +-1 2131 +-1 2134 +-1 2136 +-1 2139 +-1 2141 +-1 2146 +-1 2151 +-1 2155 +-1 2160 +-1 2165 +-1 2168 +-1 2171 +-1 2173 +-1 2176 +-1 2185 +-1 2194 +-1 2202 +-1 2211 +-1 2211 +2211 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +4095 2831 +2750 281 +269 234 +222 12 +-1 12 +-1 12 +-1 12 +-1 12 +-1 12 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 2 +-1 3 +-1 5 +-1 6 +-1 8 +-1 9 +-1 11 +-1 12 +-1 14 +-1 16 +-1 19 +-1 21 +-1 23 +-1 25 +-1 28 +-1 30 +-1 33 +-1 35 +-1 35 +-1 35 +-1 35 +-1 35 +-1 35 +-1 35 +-1 35 +-1 35 +-1 35 +-1 29 +-1 23 +-1 23 +-1 23 +-1 23 +-1 23 +-1 23 +-1 23 +-1 23 +-1 23 +-1 23 +-1 23 +-1 18 +-1 14 +-1 9 +-1 5 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 0 +-1 23 +-1 59 +-1 94 +105 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +-1 4095 +4095 2083 +-1 2083 +-1 2083 +-1 2083 +-1 2083 +-1 2083 +-1 2083 +-1 2083 +-1 2083 +-1 2083 diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..63815c6 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,163 @@ +/* +* Code Written by Quinn Henthorne: quinn.henthorne@gmail.com +* 10/7/2021 +* +* Pinout List +* Dac0 - Waveform output +* Dac1 - Amplitude output +* D2 - Synch Pin Output (For debugging purposes) +* D22 - Ampltidue Encoder Input +* D23 - Amplitude Encoder Input +* D24 - Period Encoder Input +* D25 - Period Encoder Input +* D26 - Waveform Select Encoder +* D27 - Waveform Select Encoder +*/ + + +#include +#include +#include +#include +//#include + +//uncomment to enable serial output for debugging +#define enable_serial_debug + +#define waveform_pin DAC0 +#define amplitude_pin DAC1 +#define sync_pin 2 + +// Number of waveforms available +#define waveform_num 4 +// Array of waveform arrays. Currently holds four waveforms with 600 samples each. +int waveforms[waveform_num][600] = { + {2083,2075,2067,2059,2071,2086,2100,2115,2129,2135,2141,2147,2153,2176,2176,2176,2176,2188,2201,2215,2228,2242,2255,2269,2282,2294,2305,2340,2352,2363,2376,2389,2401,2414,2427,2440,2453,2466,2478,2491,2504,2522,2539,2557,2574,2586,2597,2609,2621,2633,2644,2656,2668,2679,2691,2703,2714,2726,2738,2749,2761,2777,2792,2808,2820,2831,2843,2855,2867,2878,2890,2902,2960,2972,2984,2996,3007,3019,3030,3042,3053,3065,3078,3092,3105,3118,3131,3145,3158,3171,3181,3192,3202,3212,3223,3233,3243,3254,3264,3288,3294,3299,3314,3329,3343,3358,3364,3370,3393,3405,3417,3428,3440,3440,3452,3463,3463,3463,3463,3472,3481,3489,3498,3498,3498,3498,3498,3498,3510,3522,3522,3522,3522,3522,3522,3522,3522,3522,3522,3522,3522,3522,3522,3522,3522,3522,3522,3522,3522,3516,3510,3510,3498,3493,3487,3475,3471,3467,3463,3451,3440,3428,3416,3408,3401,3358,3346,3323,3288,3276,3253,3229,3218,3195,3171,3148,3124,3083,3042,3025,3007,2978,2948,2931,2913,2872,2831,2750,2668,2645,2621,2586,2551,2480,2445,2328,2270,2247,2223,2184,2145,1989,1954,1931,1872,1866,1860,1849,1837,1802,1785,1767,1747,1728,1708,1673,1650,1626,1609,1591,1568,1533,1521,1474,1462,1451,1439,1381,1346,1310,1264,1229,1205,1176,1147,1135,1112,1088,1077,1065,1048,1030,983,966,948,928,909,889,866,849,831,819,808,796,784,761,749,714,702,691,679,667,655,650,644,626,608,597,591,585,574,562,550,539,503,492,480,468,456,445,433,433,433,433,433,421,421,418,416,413,410,410,410,410,407,404,401,398,398,398,398,398,398,398,398,398,398,398,404,410,415,421,425,429,433,439,445,451,456,458,461,463,466,468,476,483,491,496,501,505,510,515,523,530,538,544,550,556,562,574,585,587,590,592,595,597,609,620,623,626,629,632,638,644,644,655,661,667,673,679,687,694,702,720,737,755,772,796,819,843,866,892,919,945,971,1030,1053,1123,1147,1178,1209,1240,1310,1345,1381,1416,1445,1474,1509,1544,1580,1603,1619,1634,1650,1685,1720,1767,1872,1884,1895,1907,1942,1954,1966,2012,2030,2048,2129,2188,2258,2293,2352,2434,2463,2492,2609,2656,2726,2734,2742,2750,2820,2837,2854,2871,2888,2904,2921,2938,2955,2972,2996,3019,3048,3077,3083,3089,3101,3147,3159,3171,3183,3218,3230,3241,3288,3311,3319,3327,3335,3381,3399,3416,3440,3452,3463,3463,3463,3475,3475,3475,3487,3491,3494,3498,3498,3498,3498,3498,3498,3498,3498,3502,3506,3510,3510,3510,3510,3510,3510,3510,3510,3510,3510,3510,3510,3510,3510,3487,3487,3485,3482,3480,3477,3475,3463,3459,3456,3452,3446,3440,3432,3424,3416,3411,3405,3399,3393,3370,3346,3342,3339,3335,3323,3311,3299,3299,3299,3264,3259,3253,3247,3241,3235,3229,3218,3206,3200,3194,3188,3182,3177,3171,3163,3155,3147,3136,3112,3101,3089,3074,3060,3045,3030,2995,2990,2984,2972,2960,2948,2925,2919,2913,2890,2885,2881,2876,2872,2867,2861,2855,2831,2820,2808,2802,2796,2787,2779,2770,2761,2745,2730,2691,2679,2656,2650,2597,2574,2551,2528,2399,2393,2387,2375,2363,2352,2340,2328,2305,2282,2278,2274,2270,2258,2247,2235,2223,2212,2200, + }, + {2083,2090,2097,2104,2111,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2118,2120,2122,2125,2127,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2129,2131,2134,2136,2139,2141,2146,2151,2155,2160,2165,2168,2171,2173,2176,2185,2194,2202,2211,2211,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,2831,281,234,12,12,12,12,12,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,5,6,8,9,11,12,14,16,19,21,23,25,28,30,33,35,35,35,35,35,35,35,35,35,35,29,23,23,23,23,23,23,23,23,23,23,23,18,14,9,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,59,94,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,2083,2083,2083,2083,2083,2083,2083,2083,2083,2083, + }, + {1637,1637,1637,4095,4086,4078,4069,4061,4052,4044,4035,4027,4018,4010,4001,3993,3985,3977,3968,3960,3952,3944,3936,3928,3920,3912,3903,3896,3888,3880,3872,3864,3856,3848,3840,3833,3825,3817,3810,3802,3794,3787,3779,3772,3764,3757,3749,3742,3734,3727,3720,3712,3705,3698,3690,3683,3676,3669,3662,3655,3647,3640,3633,3626,3619,3612,3605,3598,3591,3585,3578,3571,3564,3557,3551,3544,3537,3530,3524,3517,3510,3504,3497,3491,3484,3478,3471,3465,3458,3452,3446,3439,3433,3427,3420,3414,3408,3401,3395,3389,3383,3377,3371,3365,3358,3352,3346,3340,3334,3328,3322,3316,3311,3305,3299,3293,3287,3281,3276,3270,3264,3258,3253,3247,3241,3236,3230,3224,3219,3213,3208,3202,3197,3191,3186,3180,3175,3169,3164,3159,3153,3148,3143,3137,3132,3127,3121,3116,3111,3106,3101,3096,3090,3085,3080,3075,3070,3065,3060,3055,3050,3045,3040,3035,3030,3025,3020,3016,3011,3006,3001,2996,2991,2987,2982,2977,2972,2968,2963,2958,2954,2949,2945,2940,2935,2931,2926,2922,2917,2913,2908,2904,2899,2895,2890,2886,2882,2877,2873,2868,2864,2860,2855,2851,2847,2843,2838,2834,2830,2826,2822,2817,2813,2809,2805,2801,2797,2793,2789,2785,2781,2777,2773,2769,2765,2761,2757,2753,2749,2745,2741,2737,2733,2729,2725,2722,2718,2714,2710,2706,2703,2699,2695,2691,2688,2684,2680,2677,2673,2669,2666,2662,2659,2655,2651,2648,2644,2641,2637,2634,2630,2627,2623,2620,2616,2613,2609,2606,2603,2599,2596,2592,2589,2586,2582,2579,2576,2572,2569,2566,2563,2559,2556,2553,2550,2546,2543,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,1637,0,6,12,17,23,29,34,40,46,51,57,62,68,73,79,84,90,95,101,106,112,117,122,128,133,138,143,149,154,159,164,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,255,260,265,270,274,279,284,289,294,298,303,308,312,317,322,326,331,336,340,345,349,354,358,363,367,372,376,381,385,389,394,398,403,407,411,416,420,424,428,433,437,441,445,450,454,458,462,466,470,474,479,483,487,491,495,499,503,507,511,515,519,523,527,531,534,538,542,546,550,554,558,561,565,569,573,576,580,584,588,591,595,599,602,606,610,613,617,620,624,628,631,635,638,642,645,649,652,656,659,663,666,669,673,676,680,683,686,690,693,696,700,703,706,709,713,716,719,722,726,729,732,735,738,742,745,748,751,754,757,760,764,767,770,773,776,779,782,785,788,791,794,797,800,803,806,809,811,814,817,820,823,826,829,832,834,837,840,843,846,848,851,854,857,860,862,865,868,870,873,876,879,881,884,887,889,892,894,897,900,902,905,907,910,913,915,918,920,923,925,928,930,933,935,938,940,943,945,947,950,952,955,957,960,962,964,967,969,971,974,976,978,981,983,985,988,990,992,994,997,999,1001,1003,1006,1008,1010,1012,1015,1017,1019,1021,1023,1025,1028,1030,1032,1034,1637, + }, + {1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,2875,4095,4079,4062,4046,4030,4014,3999,3983,3967,3952,3937,3921,3906,3891,3876,3861,3846,3832,3817,3803,3788,3774,3760,3746,3732,3718,3704,3690,3677,3663,3650,3636,3623,3610,3597,3584,3571,3558,3545,3532,3520,3507,3495,3483,3470,3458,3446,3434,3422,3410,3399,3387,3375,3364,3352,3341,3329,3318,3307,3296,3285,3274,3263,3252,3242,3231,3220,3210,3199,3189,3179,3169,3158,3148,3138,3128,3118,3109,3099,3089,3079,3070,3060,3051,3041,3032,3023,3014,3005,2995,2986,2977,2969,2960,2951,2942,2934,2925,2916,2908,2899,2891,2883,2874,2866,2858,2850,2842,2834,2826,2818,2810,2802,2795,2787,2779,2772,2764,2757,2749,2742,2735,2727,2720,2713,2706,2699,2692,2685,2678,2671,2664,2657,2650,2644,2637,2630,2624,2617,2611,2604,2598,2591,2585,2579,2573,2566,2560,2554,2093,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,814,0,11,22,32,43,54,64,75,85,95,106,116,126,136,146,156,166,176,185,195,204,214,223,233,242,251,261,270,279,288,297,306,315,323,332,341,350,358,367,375,383,392,400,408,416,425,433,441,449,456,464,472,480,488,495,503,510,518,525,533,540,547,555,562,569,576,583,590,597,604,611,618,624,631,638,645,651,658,664,671,677,683,690,696,702,709,715,721,727,733,739,745,751,757,763,769,774,780,786,791,797,803,808,814,819,825,830,835,841,846,851,856,862,867,872,877,882,887,892,897,902,907,912,917,921,926,931,936,940,945,949,954,959,963,968,972,976,981,985,990,994,998,1002,1007,1011,1015,1019,1023,1027,1335,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638,1638, + } +}; + +//Setup encoders and their corresponding variables +Encoder amp_encoder(22, 23); +long new_amp = 64; +long old_amp = 64; +Encoder period_encoder(24, 25); +long new_period = 10; +long old_period = 10; +Encoder waveform_encoder(26, 27); +long new_waveform = 2; +long old_waveform = 2; +int waveform_select = 2; + +//Setup LCD Display +LiquidCrystal_I2C lcd(0x27,16,2); + +// Timer to regulate the step width +int timer = 0; +unsigned int millis_period = 13; + +void setup() { + //The sync pin can be run into an oscilliscope's trig channel to easiy find the waveform + pinMode(sync_pin, OUTPUT); + //Change the resolution of the analog ourput to its maximum (12 bit res) + analogWriteResolution(12); + //If serial debugging is enabled set up serial + #ifdef enable_serial_debug + Serial.begin(115200); + #endif + // Initialize timers and encoders + timer = micros(); + amp_encoder.write(new_amp*4); + period_encoder.write(new_period*4); + waveform_encoder.write(new_waveform*4); + + lcd.init(); // initialize the lcd + lcd.backlight(); +} + +void loop() { + lcd.setCursor(0,0); + lcd.print("Hello"); + // Read in encoder values + new_amp = amp_encoder.read()/4; + new_period = period_encoder.read()/4; + new_waveform = waveform_encoder.read()/4; + + // Check to see if any of the encoder values have changed. If they have, update their values. + //Handles ampltidue encoder + if(new_amp != old_amp){ + // Make sure the value is within a valid range + if(new_amp > 127){ + //128 ampltidue steps should be enough granularity + new_amp = 127; + amp_encoder.write(new_amp*4); + } + if(new_amp < 0){ + new_amp = 0; + amp_encoder.write(new_amp*4); + } + old_amp = new_amp; + } + + //Handles period encoder + if(new_period != old_period){ + // Make sure the value is within a valid range + if(new_period > 100){ + new_period = 100; + period_encoder.write(new_period*4); + } + //Anything less than three will cause errors + if(new_period < 3){ + new_period = 3; + period_encoder.write(new_period*4); + } + old_period = new_period; + } + + //Handles waveform encoder + if(new_waveform != old_waveform){ + // Make sure the value is within a valid range + if(new_waveform > waveform_num-1){ + new_waveform = waveform_num-1; + waveform_encoder.write(new_waveform*4); + } + if(new_waveform < 0){ + new_waveform = 0; + waveform_encoder.write(new_waveform*4); + } + old_waveform = new_waveform; + } + + // Creates a synch signal so an oscilliscope can more easily read irregular pulses + digitalWrite(sync_pin, !digitalRead(sync_pin)); + + // Output a signal to control the amplitude + analogWrite(amplitude_pin, map(new_amp, 0, 127, 0, 4095)); + + // The period of time each sample in the array should take in microseconds + // The 1000 converts from milliseconds to microseconds, and the 600 deivides by the number of samples in the array + // The -3 offset compensates for a 3 millisecond overhead created by the time it takes to do all of the calculations + unsigned int sample_period = (new_period-3)*1000/600; + + #ifdef enable_serial_debug + Serial.print("Ampltidue: "); + Serial.println(map(new_amp, 0, 127, 0, 4095)); + Serial.print("Period: "); + Serial.println(new_period); + Serial.print("Waveform #: "); + Serial.println(new_waveform); + delay(500); + #endif + + // Cycle through the waveform samples over a given period of time + for(int i = 0; i < 600; i++){ + while(micros()-timer < sample_period); + analogWrite(waveform_pin, waveforms[new_waveform][i]); + timer = micros(); + } +} \ No newline at end of file diff --git a/test/README b/test/README new file mode 100644 index 0000000..b94d089 --- /dev/null +++ b/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Unit Testing and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/page/plus/unit-testing.html