diff Potentiometer.cpp @ 1:c74204ea535c

added isStopped
author ark
date 2017-01-25 23:01 +0100
parents 4c32c9d4b94f
children a5e06e87f081
line wrap: on
line diff
--- a/Potentiometer.cpp	Mon Jan 23 01:50:42 2017 +0100
+++ b/Potentiometer.cpp	Wed Jan 25 23:01:54 2017 +0100
@@ -24,6 +24,7 @@
         if(this->num == Potentiometer::MAX_SAMPLES) {
             this->sum -= this->avg;
             this->num--;
+            this->isStopped = true;
         }
         this->sum += v;
         this->num++;
@@ -36,6 +37,7 @@
         this->sum = v;
         this->avg = v;
         this->num = 1;
+        this->isStopped = false;
     }
     #ifdef DEBUG
     Serial.print("pin=");
@@ -46,6 +48,8 @@
     Serial.print(num);
     Serial.print(", avg=");
     Serial.println(avg);
+    Serial.print(", isStopped=");
+    Serial.println(this->isStopped);
     #endif
 }