The TSI Analog slider whit light sensor demo for the freedom platform with Kinetis L MCU.

Dependencies:   mbed tsi_sensor

Fork of frdm_tsi_slider by Freescale

Files at this revision

API Documentation at this revision

Comitter:
pomernblueice
Date:
Sun Apr 13 08:50:23 2014 +0000
Parent:
2:b13f658fd99f
Commit message:
Obojski;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r b13f658fd99f -r a3161709a1f2 main.cpp
--- a/main.cpp	Sun Feb 23 18:32:55 2014 +0000
+++ b/main.cpp	Sun Apr 13 08:50:23 2014 +0000
@@ -13,11 +13,16 @@
 #endif
 
 int main(void) {
+    PwmOut led2(LED_RED);
     PwmOut led(LED_GREEN);
     TSIAnalogSlider tsi(ELEC0, ELEC1, 40);
+    AnalogIn light(PTE22);
+   
     
     while (true) {
-        led = 1.0 - tsi.readPercentage();
-        wait(0.1);
+        led = 1 - tsi.readPercentage();
+          if(light>0.9) led2 = 1.0 - tsi.readPercentage(); else led2=1;
+      
+          wait(0.1);
     }
 }