Matthaeus Vorraber
/
LPC1768_class_exercice2
exercise 2
Revision 2:4ceb0547f2cf, committed 2020-10-06
- Comitter:
- happy_alien
- Date:
- Tue Oct 06 16:30:54 2020 +0000
- Parent:
- 1:211adb1a2b53
- Commit message:
- exercise 2
Changed in this revision
main2.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 211adb1a2b53 -r 4ceb0547f2cf main2.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main2.cpp Tue Oct 06 16:30:54 2020 +0000 @@ -0,0 +1,53 @@ +#include "mbed.h" + +void printStatus(void); + +class MyClassA +{ +public: + MyClassA(int x, bool wahr): _x(x),_wahr(wahr) {} + + + + + + void printStatus() + { + printf("Status is now: %d,%d\n", _x,_wahr); + } + int getx(void) + { + return _x; + } +private: + int _x; + bool _wahr; +}; + +MyClassA messwert(15,1); + + + + +int main() +{ + while (1) { + + messwert.printStatus(); + wait_ms(500); + + + } +} + + +int main() +{ + while (1) { + + messwert.printStatus(); + wait_ms(500); + + + } +}