From eaa7c938c5ae3f3befa90ac0652cfc2f1f0e0724 Mon Sep 17 00:00:00 2001 From: Regimantas Date: Tue, 17 Dec 2019 18:19:21 +0200 Subject: [PATCH] Add files via upload --- library.properties | 2 +- src/Oversampling.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/library.properties b/library.properties index c710cfe..ffa8f49 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Oversampling -version=0.9.3 +version=0.9.4 author=Regimnatas Baublys maintainer=Regimnatas Baublys sentence=Improving ADC Resolution By Oversampling Averaging. diff --git a/src/Oversampling.cpp b/src/Oversampling.cpp index b3a297a..7eabd6e 100644 --- a/src/Oversampling.cpp +++ b/src/Oversampling.cpp @@ -35,6 +35,18 @@ int Oversampling::read(int pin) OversampleCount = 64; DecimationCount = 8; } + if (SampleCount==4){ + OversampleCount = 256; + DecimationCount = 16; + } + if (SampleCount==5){ + OversampleCount = 1024; + DecimationCount = 32; + } + if (SampleCount==6){ + OversampleCount = 4096; + DecimationCount = 64; + } // Can Lead To Overflow unsigned long TotalADC = 0;