TINF-06-10-2020

Dependencies:   mbed

Committer:
tina_dokic
Date:
Tue Oct 06 16:51:48 2020 +0000
Revision:
0:aaf0e1fabb9c
TINF

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tina_dokic 0:aaf0e1fabb9c 1 #include "mbed.h"
tina_dokic 0:aaf0e1fabb9c 2
tina_dokic 0:aaf0e1fabb9c 3
tina_dokic 0:aaf0e1fabb9c 4
tina_dokic 0:aaf0e1fabb9c 5 class MyClassA {
tina_dokic 0:aaf0e1fabb9c 6 public:
tina_dokic 0:aaf0e1fabb9c 7 MyClassA(int x, bool wahr) : _x(x), _wahr(wahr)
tina_dokic 0:aaf0e1fabb9c 8 {
tina_dokic 0:aaf0e1fabb9c 9
tina_dokic 0:aaf0e1fabb9c 10 }
tina_dokic 0:aaf0e1fabb9c 11
tina_dokic 0:aaf0e1fabb9c 12 void status()
tina_dokic 0:aaf0e1fabb9c 13 {
tina_dokic 0:aaf0e1fabb9c 14 printf("%d,%d\n",_x, _wahr);
tina_dokic 0:aaf0e1fabb9c 15 }
tina_dokic 0:aaf0e1fabb9c 16 int getx(void)
tina_dokic 0:aaf0e1fabb9c 17 {
tina_dokic 0:aaf0e1fabb9c 18 return _x;
tina_dokic 0:aaf0e1fabb9c 19
tina_dokic 0:aaf0e1fabb9c 20 }
tina_dokic 0:aaf0e1fabb9c 21 private:
tina_dokic 0:aaf0e1fabb9c 22 int _x;
tina_dokic 0:aaf0e1fabb9c 23 bool _wahr;
tina_dokic 0:aaf0e1fabb9c 24
tina_dokic 0:aaf0e1fabb9c 25 };
tina_dokic 0:aaf0e1fabb9c 26
tina_dokic 0:aaf0e1fabb9c 27 MyClassA myClass(5,1);
tina_dokic 0:aaf0e1fabb9c 28
tina_dokic 0:aaf0e1fabb9c 29 int main()
tina_dokic 0:aaf0e1fabb9c 30 {
tina_dokic 0:aaf0e1fabb9c 31
tina_dokic 0:aaf0e1fabb9c 32 while(1)
tina_dokic 0:aaf0e1fabb9c 33 {
tina_dokic 0:aaf0e1fabb9c 34 myClass.status();
tina_dokic 0:aaf0e1fabb9c 35 wait_ms(500);
tina_dokic 0:aaf0e1fabb9c 36 }
tina_dokic 0:aaf0e1fabb9c 37
tina_dokic 0:aaf0e1fabb9c 38
tina_dokic 0:aaf0e1fabb9c 39
tina_dokic 0:aaf0e1fabb9c 40
tina_dokic 0:aaf0e1fabb9c 41 }