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 06-01-Uebung by
main.cpp@3:6dfb04216698, 2015-02-21 (annotated)
- Committer:
- stefan1691
- Date:
- Sat Feb 21 10:51:40 2015 +0000
- Revision:
- 3:6dfb04216698
- Parent:
- 2:83598aa88c56
- Child:
- 4:be63bf4e87aa
6.1 Licht bei D?mmerung einschalten
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| stefan1691 | 3:6dfb04216698 | 1 | /** 6.1 Licht bei Dämmerung einschalten |
| stefan1691 | 0:531fa4200009 | 2 | */ |
| stefan1691 | 0:531fa4200009 | 3 | |
| stefan1691 | 0:531fa4200009 | 4 | #include "mbed.h" |
| stefan1691 | 0:531fa4200009 | 5 | |
| stefan1691 | 3:6dfb04216698 | 6 | AnalogIn light( A1 ); |
| stefan1691 | 0:531fa4200009 | 7 | DigitalOut led( D10 ); // 1. LED auf thShield |
| stefan1691 | 0:531fa4200009 | 8 | |
| stefan1691 | 0:531fa4200009 | 9 | int main() |
| stefan1691 | 0:531fa4200009 | 10 | { |
| stefan1691 | 0:531fa4200009 | 11 | while ( true ) |
| stefan1691 | 0:531fa4200009 | 12 | { |
| stefan1691 | 3:6dfb04216698 | 13 | // fuer Dunklen Kursraum |
| stefan1691 | 3:6dfb04216698 | 14 | if ( light < 0.01f ) |
| stefan1691 | 0:531fa4200009 | 15 | led = 1; |
| stefan1691 | 0:531fa4200009 | 16 | else |
| stefan1691 | 0:531fa4200009 | 17 | led = 0; |
| stefan1691 | 3:6dfb04216698 | 18 | wait( 1.0 ); |
| stefan1691 | 0:531fa4200009 | 19 | } |
| stefan1691 | 0:531fa4200009 | 20 | } |
