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 _B14_Lektion02c by
Revision 3:f63f8af9a3cb, committed 2017-05-13
- Comitter:
- Enenkel
- Date:
- Sat May 13 10:05:03 2017 +0000
- Parent:
- 2:d70f3a0e2cd4
- Commit message:
- B17_Lektion02c
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Mar 20 09:59:40 2015 +0000
+++ b/main.cpp Sat May 13 10:05:03 2017 +0000
@@ -1,39 +1,43 @@
-/***********************************
-name: _B14_Lektion02c Lauflicht 1 LED via BUS
+/*****************************************************************************
+name: B17_Lektion02c Lauflicht 1 LED via BUS
author: Gottfried Enenkel HTL BULME
-date: 15.3.2015
+date: 15.5.2017
Aufgabe:
Lade die Software, führe sie aus.
- Verändere die Software so, dass folgendes Lauflicht entsteht
+ Verändere die Software so, dass folgendes Lauflicht entsteht
D10 D11 D12 D13
- - - - Ein Durchgang dauert 3,5 sec
X - - - X=ON - = off
- - X - -
+ - X - -
- - X -
- - - X
- - - -
- - - X ab hier wieder zurück
-**********************************/
+*****************************************************************************/
#include "mbed.h"
// ******* Definitionen ********
// Statt DigitalOut wird nun BusOut verwendet !
BusOut leds(P1_8, P1_9, P1_10, P1_11); //LEDS als Bus definieren
// ******* Hauptroutine ********
-int main() { // 0x bedeutet eine HEX Zahl folgt (0-F)
- while(1) { // Alle LED ein > 0xF; 8 4 2 1
- leds = 0x0; // Alle LED aus 0x0; Alle LED EIN > 0xF;
+int main() // 0x bedeutet eine HEX Zahl folgt (0-F)
+{
+ while(1) { // Alle LED ein > 0xF; 8+4+2+1=15=F
+ leds = 0x0; // Alle LED aus 0x0;
wait(0.5); // 8 4 2 1 Wert
- leds = 0x1; // 0 0 0 1;
- wait(0.5);
+ leds = 0x1; // 0 0 0 1; 0x8+0+4+0x2+1+1=dec 1 = hex 1
+ wait(0.5);
leds = 0x3; // 0 0 1 1;
- wait (0.5);
+ wait (0.5);
leds = 0x4; // 0 1 0 0;
wait(0.5);
-
+
// füge hier deine Software ein !
- } // Springe zum Anfang der Schleife
-} // Ende Hauptprogramm
+
+ leds=(0xF); // 1 1 1 1, Alle LEDS ON = dec15 =hec F
+
+ } // Springe zum Anfang der Schleife
+} // Ende Hauptprogramm
// ******* Ende *********
--- a/mbed.bld Fri Mar 20 09:59:40 2015 +0000 +++ b/mbed.bld Sat May 13 10:05:03 2017 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/5e5da4a5990b \ No newline at end of file +https://mbed.org/users/mbed_official/code/mbed/builds/4eea097334d6 \ No newline at end of file
