![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
aufgabe1_blinker
Dependencies: mbed HelloWorld
Revision 2:95f947d9925e, committed 2019-02-27
- Comitter:
- huam
- Date:
- Wed Feb 27 09:02:44 2019 +0000
- Parent:
- 1:03c191369089
- Commit message:
- Elektroniker-Schnupperlehre Aufgabe1
Changed in this revision
diff -r 03c191369089 -r 95f947d9925e blink.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/blink.lib Wed Feb 27 09:02:44 2019 +0000 @@ -0,0 +1,1 @@ +http://os.mbed.com/users/simon/code/HelloWorld/#03c191369089
diff -r 03c191369089 -r 95f947d9925e main.cpp --- a/main.cpp Sun Jan 01 20:57:57 2012 +0000 +++ b/main.cpp Wed Feb 27 09:02:44 2019 +0000 @@ -1,12 +1,11 @@ #include "mbed.h" - -DigitalOut myled(LED1); +#include "maxon_sl.h" int main() { - while(1) { - myled = 1; - wait(0.2); - myled = 0; - wait(0.2); + IMMER { // Das Programm wird dauernd ausgeführt + LED(3,EIN); // LED Nummer 3 einschalten + WARTE(1.5); // Wartezeit 1.5 Sekunden + LED(3,AUS); // LED Nummer 3 ausschalten + WARTE(1.5); // Wartezeit 1.5 Sekunden } }
diff -r 03c191369089 -r 95f947d9925e maxon_sl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/maxon_sl.h Wed Feb 27 09:02:44 2019 +0000 @@ -0,0 +1,65 @@ + +#define IMMER while(1) +#define EIN 1 +#define AUS 0 +#define AUF 1 +#define ZU 0 +#define WARTE(A) wait(A) + +DigitalOut myled(LED1); +DigitalOut LAMPE1(p21); +DigitalOut LAMPE2(p22); +DigitalOut LAMPE3(p23); +DigitalOut LAMPE4(p24); +DigitalOut LAMPE5(p25); +DigitalOut LAMPE6(p26); +DigitalOut LAMPE7(p27); +DigitalOut LAMPE8(p28); + +DigitalIn TASTE1(p6); +DigitalIn TASTE2(p8); +DigitalIn TASTE3(p10); + +void INPUTS(void); +void LED(int,int); + +void INPUTS() { + TASTE1.mode(PullNone); + TASTE2.mode(PullNone); + TASTE3.mode(PullNone); +} + + +void LED(int Nummer,int Aktion) { + if ((Aktion <= 1) && (Aktion >= 0)) { + switch(Nummer) { + case 1: + LAMPE1 = Aktion; + break; + case 2: + LAMPE2 = Aktion; + break; + case 3: + LAMPE3 = Aktion; + break; + case 4: + LAMPE4 = Aktion; + break; + case 5: + LAMPE5 = Aktion; + break; + case 6: + LAMPE6 = Aktion; + break; + case 7: + LAMPE7 = Aktion; + break; + case 8: + LAMPE8 = Aktion; + break; + } + } +} + + + \ No newline at end of file
diff -r 03c191369089 -r 95f947d9925e mbed.bld --- a/mbed.bld Sun Jan 01 20:57:57 2012 +0000 +++ b/mbed.bld Wed Feb 27 09:02:44 2019 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/078e4b97a13e +http://mbed.org/users/mbed_official/code/mbed/builds/994bdf8177cb \ No newline at end of file