AMart_ssd447_hw3.2

Dependencies:   SLCD mbed

Fork of lightsense_kl46z_PWM_simple by Stanley Cohen

Revision:
9:6f92125f8361
Parent:
8:ea818c9220fc
--- a/main.cpp	Mon Jan 25 16:10:38 2016 +0000
+++ b/main.cpp	Fri Feb 03 21:48:45 2017 +0000
@@ -36,13 +36,14 @@
     while(true) {    
         if (LEDTimer.read_ms() > timeToChangeDF){ // check for timer time out transtion
             lightData = (1.0 - LightSensor.read()); // show as increasiing with increasing intensity
+            if(lightData >= 0.0 && lightData <= 1000.0){
             greenColor.write(1.0- lightData);
             redColor.write(1.0-lightData);
             sprintf(lcdData,"%4.3f",lightData);
             LCDMess(lcdData);  
             pc.printf("%4.3f\r\n",lightData);
             timeToChangeDF = DATATIME;
-            LEDTimer.reset();
+            LEDTimer.reset();}
         }        
     }// emd while
 }