Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of 03-01-Uebung by
Diff: main.cpp
- 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
    