# HG changeset patch # User ark # Date 1498088551 -7200 # Node ID ea44b28e12ab5753bc7a9027df1f0bae1fc1b664 # Parent 53e0509faa3c37519137d84cf097f574133ebc9c 1.0.2 update - setup now resets the object diff -r 53e0509faa3c -r ea44b28e12ab Potentiometer.cpp --- a/Potentiometer.cpp Fri Jun 02 22:09:56 2017 +0200 +++ b/Potentiometer.cpp Thu Jun 22 01:42:31 2017 +0200 @@ -1,9 +1,4 @@ -#if defined(ARDUINO) && ARDUINO >= 100 #include "Arduino.h" -#else -#include "WProgram.h" -#endif - #include "Potentiometer.h" @@ -16,6 +11,10 @@ void Potentiometer::setup(byte pin) { this->pin = pin; pinMode(this->pin, INPUT); + this->isStopped = false; + this->sum = 0.0; + this->avg = 0.0; + this->num = 0; } void Potentiometer::update() { diff -r 53e0509faa3c -r ea44b28e12ab Potentiometer.h --- a/Potentiometer.h Fri Jun 02 22:09:56 2017 +0200 +++ b/Potentiometer.h Thu Jun 22 01:42:31 2017 +0200 @@ -22,7 +22,7 @@ Potentiometer(); /** - setup pot instance. + setup or reset pot instance. @param {byte} pin input pin */ void setup(byte pin); diff -r 53e0509faa3c -r ea44b28e12ab library.properties --- a/library.properties Fri Jun 02 22:09:56 2017 +0200 +++ b/library.properties Thu Jun 22 01:42:31 2017 +0200 @@ -1,9 +1,9 @@ name=Potentiometer -version=1.0.1 +version=1.0.2 author=Arkadiusz Juszczyk maintainer=Arkadiusz Juszczyk sentence=Dejittered potentiometer for Arduino -paragraph=Encapsulates de-jittered potentiometer +paragraph=Handles jitter averaging on a potentiometer to deliver a stable value. category=Signal Input/Output url=https://hg.wobblyhead.net/arduino/Potentiometer architectures=*