th.iotkit.ch / Mbed 2 deprecated 06-01-Uebung

Dependencies:   mbed

Fork of 03-01-Uebung by th.iotkit.ch

Revision:
3:6dfb04216698
Parent:
2:83598aa88c56
--- a/main.cpp	Sat Feb 21 07:55:14 2015 +0000
+++ b/main.cpp	Sat Feb 21 10:51:40 2015 +0000
@@ -1,18 +1,20 @@
-/** 3.1 Neues Programm mittels Assistenten erstellen
+/** 6.1 Licht bei Dämmerung einschalten
 */
 
 #include "mbed.h"
 
-DigitalIn   button1( PTC9, PullUp );        // 1. Button auf thShield   
+AnalogIn   light( A1 );
 DigitalOut  led( D10 );             // 1. LED auf thShield
 
 int main()
 {
     while ( true ) 
     {
-        if  ( button1 == 0 )        // Button gedrueckt
+        // fuer Dunklen Kursraum
+        if  ( light < 0.01f )
             led = 1;
         else
             led = 0;
+        wait( 1.0 );
     }
 }
\ No newline at end of file