Class

Dependencies:   mbed

Committer:
tina_dokic
Date:
Tue Oct 06 16:15:06 2020 +0000
Revision:
0:67dce664aae3
Class-uebung

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tina_dokic 0:67dce664aae3 1 #include "mbed.h"
tina_dokic 0:67dce664aae3 2
tina_dokic 0:67dce664aae3 3 class MyClass{
tina_dokic 0:67dce664aae3 4 public:
tina_dokic 0:67dce664aae3 5 MyClass(double messwert) : _messwert(messwert)
tina_dokic 0:67dce664aae3 6 {
tina_dokic 0:67dce664aae3 7 }
tina_dokic 0:67dce664aae3 8 void status(){
tina_dokic 0:67dce664aae3 9 printf("%f\n",_messwert);
tina_dokic 0:67dce664aae3 10 }
tina_dokic 0:67dce664aae3 11 private:
tina_dokic 0:67dce664aae3 12 double _messwert;
tina_dokic 0:67dce664aae3 13 };
tina_dokic 0:67dce664aae3 14 MyClass myClass(0.0);
tina_dokic 0:67dce664aae3 15
tina_dokic 0:67dce664aae3 16 int main()
tina_dokic 0:67dce664aae3 17 {
tina_dokic 0:67dce664aae3 18
tina_dokic 0:67dce664aae3 19 while(1)
tina_dokic 0:67dce664aae3 20 {
tina_dokic 0:67dce664aae3 21 myClass.status();
tina_dokic 0:67dce664aae3 22 wait_ms(500);
tina_dokic 0:67dce664aae3 23 }
tina_dokic 0:67dce664aae3 24
tina_dokic 0:67dce664aae3 25
tina_dokic 0:67dce664aae3 26
tina_dokic 0:67dce664aae3 27
tina_dokic 0:67dce664aae3 28 }
tina_dokic 0:67dce664aae3 29