First class MyLed with member initializer lists
MyLed.h@0:6a370b8037bf, 2020-10-06 (annotated)
- Committer:
- bulmecisco
- Date:
- Tue Oct 06 15:32:23 2020 +0000
- Revision:
- 0:6a370b8037bf
First program with member initializer lists
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bulmecisco | 0:6a370b8037bf | 1 | #include "mbed.h" |
bulmecisco | 0:6a370b8037bf | 2 | #ifndef MYLED_H |
bulmecisco | 0:6a370b8037bf | 3 | #define MYLED_H |
bulmecisco | 0:6a370b8037bf | 4 | |
bulmecisco | 0:6a370b8037bf | 5 | // Klasse |
bulmecisco | 0:6a370b8037bf | 6 | class MyLed{ |
bulmecisco | 0:6a370b8037bf | 7 | private: |
bulmecisco | 0:6a370b8037bf | 8 | // Memebervariable |
bulmecisco | 0:6a370b8037bf | 9 | DigitalOut _led; |
bulmecisco | 0:6a370b8037bf | 10 | const int _wert; |
bulmecisco | 0:6a370b8037bf | 11 | public: |
bulmecisco | 0:6a370b8037bf | 12 | // Konstruktor |
bulmecisco | 0:6a370b8037bf | 13 | MyLed(PinName led) : _led(led), _wert(0) { |
bulmecisco | 0:6a370b8037bf | 14 | } |
bulmecisco | 0:6a370b8037bf | 15 | // Methodenprototyping |
bulmecisco | 0:6a370b8037bf | 16 | void ledOn(); |
bulmecisco | 0:6a370b8037bf | 17 | void ledOff(); |
bulmecisco | 0:6a370b8037bf | 18 | void printStatus(); |
bulmecisco | 0:6a370b8037bf | 19 | }; |
bulmecisco | 0:6a370b8037bf | 20 | #endif |