Fritz Hausmann
/
Bertl_LED
LED
main.cpp@0:7d61b3dfaa5e, 2015-04-23 (annotated)
- Committer:
- fritzhausmann
- Date:
- Thu Apr 23 12:06:41 2015 +0000
- Revision:
- 0:7d61b3dfaa5e
LED
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fritzhausmann | 0:7d61b3dfaa5e | 1 | #include "mbed.h" |
fritzhausmann | 0:7d61b3dfaa5e | 2 | #include "ur_Bertl.h" |
fritzhausmann | 0:7d61b3dfaa5e | 3 | #include "const.h" |
fritzhausmann | 0:7d61b3dfaa5e | 4 | |
fritzhausmann | 0:7d61b3dfaa5e | 5 | class Led_Bertl : public ur_Bertl // Klasse deklarieren |
fritzhausmann | 0:7d61b3dfaa5e | 6 | { |
fritzhausmann | 0:7d61b3dfaa5e | 7 | public: |
fritzhausmann | 0:7d61b3dfaa5e | 8 | void Turn2LedOn(); // Methodenprototyping |
fritzhausmann | 0:7d61b3dfaa5e | 9 | }; |
fritzhausmann | 0:7d61b3dfaa5e | 10 | |
fritzhausmann | 0:7d61b3dfaa5e | 11 | void Led_Bertl :: Turn2LedOn() // Methodendefinition |
fritzhausmann | 0:7d61b3dfaa5e | 12 | { |
fritzhausmann | 0:7d61b3dfaa5e | 13 | TurnLedOff(LED_ALL); |
fritzhausmann | 0:7d61b3dfaa5e | 14 | TurnLedOn(LED_BL1 | LED_BR1); |
fritzhausmann | 0:7d61b3dfaa5e | 15 | } |
fritzhausmann | 0:7d61b3dfaa5e | 16 | |
fritzhausmann | 0:7d61b3dfaa5e | 17 | int main() |
fritzhausmann | 0:7d61b3dfaa5e | 18 | { |
fritzhausmann | 0:7d61b3dfaa5e | 19 | |
fritzhausmann | 0:7d61b3dfaa5e | 20 | Led_Bertl karel; // Objekt erzeugen (installieren) |
fritzhausmann | 0:7d61b3dfaa5e | 21 | |
fritzhausmann | 0:7d61b3dfaa5e | 22 | karel.Turn2LedOn(); // Objektmethode aufrufen |
fritzhausmann | 0:7d61b3dfaa5e | 23 | karel.Move(); |
fritzhausmann | 0:7d61b3dfaa5e | 24 | karel.ShutOff(); |
fritzhausmann | 0:7d61b3dfaa5e | 25 | } |