From: Eugene Crosser Date: Tue, 2 Jan 2018 18:26:52 +0000 (+0100) Subject: streamline logic, adjust ambient light value X-Git-Url: http://www.average.org/gitweb/?p=sensor-light.git;a=commitdiff_plain;h=c9ef989a5af20427a69004b565b48e7e30316326;ds=sidebyside streamline logic, adjust ambient light value --- diff --git a/msp430/main.c b/msp430/main.c index 5430229..03786aa 100644 --- a/msp430/main.c +++ b/msp430/main.c @@ -6,7 +6,7 @@ enum {ev_btn1 = 0, ev_btn2, ev_pir1, ev_pir2, ev_tmr, ev_adc, ev_MAX}; #define PWM_ORDER 10 #define PWM_HALF 5 -#define LIGHT_THRESHOLD 200 +#define LIGHT_THRESHOLD 600 #define TIME_ON 16 #ifdef ADCSC /* Let us hope that this is a "new" model */ @@ -114,10 +114,6 @@ int main(void) P1OUT |= BIT_GL; // Set green LED on if (events & 1< 0) { - Time_Left = TIME_ON; - continue; - } // Sampling and conversion start #ifdef ADCENC ADCCTL0 |= ADCENC | ADCSC; @@ -131,8 +127,6 @@ int main(void) if (events & 1<