Last active
February 5, 2018 06:03
-
-
Save arodland/962a2b4ea947e7057d5ba49bb13e0e33 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void loop() { | |
| ritval = analogRead(ritPin); | |
| cwoffset = digitalRead(4); | |
| unsigned long vfo = freq; // Start with the dial frequency | |
| if (cwoffset) { | |
| vfo += 800; // +800Hz CW shift | |
| } | |
| vfo += (ritval - 512) * 10; // About a +/- 5kHz range | |
| if (vfo != freqOld) { | |
| AD9833setFrequency(vfo, SINE); | |
| freqOld = vfo; | |
| } | |
| // That's all, folks | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment