First class MyLed with member initializer lists
MyLed.cpp@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 | #include "MyLed.h" |
bulmecisco | 0:6a370b8037bf | 3 | |
bulmecisco | 0:6a370b8037bf | 4 | // Methoden oder Memberfunktions |
bulmecisco | 0:6a370b8037bf | 5 | void MyLed::ledOn() { |
bulmecisco | 0:6a370b8037bf | 6 | _led = 1; |
bulmecisco | 0:6a370b8037bf | 7 | } |
bulmecisco | 0:6a370b8037bf | 8 | |
bulmecisco | 0:6a370b8037bf | 9 | void MyLed::ledOff() { |
bulmecisco | 0:6a370b8037bf | 10 | _led = _wert; |
bulmecisco | 0:6a370b8037bf | 11 | } |
bulmecisco | 0:6a370b8037bf | 12 | |
bulmecisco | 0:6a370b8037bf | 13 | void MyLed::printStatus() { |
bulmecisco | 0:6a370b8037bf | 14 | printf("Led is now: %d\n", _led.read()); |
bulmecisco | 0:6a370b8037bf | 15 | } |