From 71ef15151c5b4c155f50b1e78d789bed86f4f437 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Mon, 8 Mar 2010 20:54:45 +0000 Subject: [PATCH] light level update --- rf433ctl/rf433ctl.pde | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rf433ctl/rf433ctl.pde b/rf433ctl/rf433ctl.pde index f404110..6ead8af 100644 --- a/rf433ctl/rf433ctl.pde +++ b/rf433ctl/rf433ctl.pde @@ -227,7 +227,7 @@ void updateLightLevel(unsigned int pin) return; unsigned int diff = abs(value - light_level_mean_); - if (diff > 250) + if (light_level_mean_ < 6 || diff > 250) light_level_mean_ = value; else light_level_mean_=(unsigned int) ( ((float) light_level_mean_) * 0.98 + ((float)value)*0.02 ); -- 1.7.10.4