From 6726836631b9f991da22e22cb9fa0302839abeab Mon Sep 17 00:00:00 2001 From: nick6x Date: Sun, 30 Jul 2017 12:07:00 -0700 Subject: [PATCH] Fix example --- examples/SimpleSin/SimpleSin.ino | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/examples/SimpleSin/SimpleSin.ino b/examples/SimpleSin/SimpleSin.ino index 50be57d..24684ce 100644 --- a/examples/SimpleSin/SimpleSin.ino +++ b/examples/SimpleSin/SimpleSin.ino @@ -9,7 +9,7 @@ #define PWM_PIN 3 -#define DDS_USE_ONLY_TIMER2 false +#define DDS_USE_ONLY_TIMER2 true #define TIMER2_PHASE_ADVANCE 24 DDS dds; @@ -40,13 +40,11 @@ ISR(TIMER2_OVF_vect) { } #else // Use the ADC timer instead ISR(ADC_vect) { - if(false){ - static unsigned char tcnt = 0; - TIFR1 = _BV(ICF1); // Clear the timer flag - if(++tcnt == 4) { - tcnt = 0; - } - dds.clockTick(); + static unsigned char tcnt = 0; + TIFR1 = _BV(ICF1); // Clear the timer flag + if(++tcnt == 4) { + tcnt = 0; } + dds.clockTick(); } #endif \ No newline at end of file