Stefan Seebacher
/
M0_Uebung_2f
M0_Übung_2f
Fork of M0_Lektion02f by
main.cpp@3:3b0264bdf220, 2016-04-21 (annotated)
- Committer:
- StefanSeebacher
- Date:
- Thu Apr 21 07:51:02 2016 +0000
- Revision:
- 3:3b0264bdf220
- Parent:
- 2:19f9c4ff509b
M0_?bung_2f
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Enenkel | 0:748e9d643973 | 1 | #include "mbed.h" |
StefanSeebacher | 3:3b0264bdf220 | 2 | |
StefanSeebacher | 3:3b0264bdf220 | 3 | // **** DEFINITIONEN **** |
StefanSeebacher | 3:3b0264bdf220 | 4 | |
StefanSeebacher | 3:3b0264bdf220 | 5 | BusOut led(P1_13,P1_12,P1_7,P1_6,P1_4,P1_3,P1_1,P1_0,LED4,LED3,LED2,LED1); |
StefanSeebacher | 3:3b0264bdf220 | 6 | |
StefanSeebacher | 3:3b0264bdf220 | 7 | // **** HAUPTPROGRAMM **** |
Enenkel | 0:748e9d643973 | 8 | |
StefanSeebacher | 3:3b0264bdf220 | 9 | int main() { |
StefanSeebacher | 3:3b0264bdf220 | 10 | while(1) |
Enenkel | 0:748e9d643973 | 11 | { |
StefanSeebacher | 3:3b0264bdf220 | 12 | led=0x000; //LED 0000 0000 0000 |
Enenkel | 0:748e9d643973 | 13 | wait(0.2); |
StefanSeebacher | 3:3b0264bdf220 | 14 | led=0x001; //LED 0000 0000 0001 |
StefanSeebacher | 3:3b0264bdf220 | 15 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 16 | led=0x003; //LED 0000 0000 0011 |
StefanSeebacher | 3:3b0264bdf220 | 17 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 18 | led=0x007; //LED 0000 0000 0111 |
StefanSeebacher | 3:3b0264bdf220 | 19 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 20 | led=0x00F; //LED 0000 0000 1111 |
StefanSeebacher | 3:3b0264bdf220 | 21 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 22 | led=0x01E; //LED 0000 0001 1110 |
StefanSeebacher | 3:3b0264bdf220 | 23 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 24 | led=0x03C; //LED 0000 0011 1100 |
StefanSeebacher | 3:3b0264bdf220 | 25 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 26 | led=0x078; //LED 0000 0111 1000 |
StefanSeebacher | 3:3b0264bdf220 | 27 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 28 | led=0x0F0; //LED 0000 1111 0000 |
Enenkel | 0:748e9d643973 | 29 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 30 | led=0x1E0; //LED 0001 1110 0000 |
StefanSeebacher | 3:3b0264bdf220 | 31 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 32 | led=0x3C0; //LED 0011 1100 0000 |
StefanSeebacher | 3:3b0264bdf220 | 33 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 34 | led=0x780; //LED 0111 1000 0000 |
StefanSeebacher | 3:3b0264bdf220 | 35 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 36 | led=0xF00; //LED 1111 0000 0000 |
StefanSeebacher | 3:3b0264bdf220 | 37 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 38 | led=0xE00; //LED 1110 0000 0000 |
StefanSeebacher | 3:3b0264bdf220 | 39 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 40 | led=0xC00; //LED 1100 0000 0000 |
StefanSeebacher | 3:3b0264bdf220 | 41 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 42 | led=0x800; //LED 1000 0000 0000 |
StefanSeebacher | 3:3b0264bdf220 | 43 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 44 | led=0x000; //LED 0000 0000 0000 |
Enenkel | 0:748e9d643973 | 45 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 46 | |
StefanSeebacher | 3:3b0264bdf220 | 47 | // Zurück |
StefanSeebacher | 3:3b0264bdf220 | 48 | |
StefanSeebacher | 3:3b0264bdf220 | 49 | led=0x000; //LED 0000 0000 0000 |
StefanSeebacher | 3:3b0264bdf220 | 50 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 51 | led=0x800; //LED 1000 0000 0000 |
StefanSeebacher | 3:3b0264bdf220 | 52 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 53 | led=0xC00; //LED 1100 0000 0000 |
StefanSeebacher | 3:3b0264bdf220 | 54 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 55 | led=0xE00; //LED 1110 0000 0000 |
StefanSeebacher | 3:3b0264bdf220 | 56 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 57 | led=0xF00; //LED 1111 0000 0000 |
StefanSeebacher | 3:3b0264bdf220 | 58 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 59 | led=0x780; //LED 0111 1000 0000 |
StefanSeebacher | 3:3b0264bdf220 | 60 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 61 | led=0x3C0; //LED 0011 1100 0000 |
StefanSeebacher | 3:3b0264bdf220 | 62 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 63 | led=0x1E0; //LED 0001 1110 0000 |
StefanSeebacher | 3:3b0264bdf220 | 64 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 65 | led=0x0F0; //LED 0000 1111 0000 |
StefanSeebacher | 3:3b0264bdf220 | 66 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 67 | led=0x078; //LED 0000 0111 1000 |
StefanSeebacher | 3:3b0264bdf220 | 68 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 69 | led=0x03C; //LED 0000 0011 1100 |
StefanSeebacher | 3:3b0264bdf220 | 70 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 71 | led=0x01E; //LED 0000 0001 1110 |
StefanSeebacher | 3:3b0264bdf220 | 72 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 73 | led=0x00F; //LED 0000 0000 1111 |
StefanSeebacher | 3:3b0264bdf220 | 74 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 75 | led=0x007; //LED 0000 0000 0111 |
StefanSeebacher | 3:3b0264bdf220 | 76 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 77 | led=0x003; //LED 0000 0000 0011 |
StefanSeebacher | 3:3b0264bdf220 | 78 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 79 | led=0x001; //LED 0000 0000 0001 |
StefanSeebacher | 3:3b0264bdf220 | 80 | wait (0.2); |
StefanSeebacher | 3:3b0264bdf220 | 81 | led=0x000; //LED 0000 0000 0000 |
StefanSeebacher | 3:3b0264bdf220 | 82 | wait(0.2); |
StefanSeebacher | 3:3b0264bdf220 | 83 | |
Enenkel | 0:748e9d643973 | 84 | } |
Enenkel | 0:748e9d643973 | 85 | } |
StefanSeebacher | 3:3b0264bdf220 | 86 | // **** ENDE **** |