KIK 01 Prototype 05

Dependencies:   AverageMCP3008 mbed-rtos mbed mcp3008

Fork of KIK01_Proto03 by Ryo Od

Revision:
7:6735a343780e
Parent:
6:897d6392b408
Child:
8:bb34a4894337
--- a/main.cpp	Sun Jun 04 09:32:30 2017 +0000
+++ b/main.cpp	Sun Jun 04 09:36:09 2017 +0000
@@ -160,7 +160,7 @@
     amplitude = envelopeAmplitude.getAmplitude(envelopeTicks);
 
     envelopeTicks++;
-    if (envelopeTicks == envelopeLength) {
+    if (envelopeTicks >= envelopeLength) {
         envelopeTicks = 0;
     }
 }
@@ -168,7 +168,7 @@
 void update()
 {
     ticks++;
-    if (ticks == SAMPLING_RATE / 1000) {
+    if (ticks >= SAMPLING_RATE / 1000) {
         ticks = 0;
         
         // set envelope parameters