summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkliment <kliment.yanev@gmail.com>2011-07-16 14:13:15 +0200
committerkliment <kliment.yanev@gmail.com>2011-07-16 14:13:15 +0200
commita5ded5b75fe6d512b74bca5e5c87e9e66995b997 (patch)
tree9d9c9d2879e4a75521dda5283968b88509d7475a
parent57f4c09d1783569609c4116d260978f5e47eb049 (diff)
parented44404bec8c6de621ee20a27e61ec1f783df483 (diff)
Merge branch 'master' of github.com:kliment/Sprinter into experimental
-rw-r--r--Sprinter/Sprinter.pde3
1 files changed, 2 insertions, 1 deletions
diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde
index 8bb68d7..8578359 100644
--- a/Sprinter/Sprinter.pde
+++ b/Sprinter/Sprinter.pde
@@ -127,7 +127,7 @@ int tt = 0, bt = 0;
int temp_iState_max = 100 * PID_INTEGRAL_DRIVE_MAX / PID_IGAIN;
#endif
#ifdef SMOOTHING
- uint32_t nma = SMOOTHFACTOR * analogRead(TEMP_0_PIN);
+ uint32_t nma = 0;
#endif
#ifdef WATCHPERIOD
int watch_raw = -1000;
@@ -1389,6 +1389,7 @@ void manage_heater()
current_raw = read_max6675();
#endif
#ifdef SMOOTHING
+ if (!nma) nma = SMOOTHFACTOR * current_raw;
nma = (nma + current_raw) - (nma / SMOOTHFACTOR);
current_raw = nma / SMOOTHFACTOR;
#endif