1 Uebung

Dependencies:   mbed

Committer:
rob117
Date:
Tue Oct 06 15:50:31 2020 +0000
Revision:
2:3c3a6f0b11d2
Parent:
1:851c54e0d307
Child:
3:dbd662e5f8f8
robinHandy; 1Uebung

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rob117 0:928e720c71da 1 #include "mbed.h"
rob117 2:3c3a6f0b11d2 2
rob117 2:3c3a6f0b11d2 3 class MyClass
rob117 2:3c3a6f0b11d2 4 {
rob117 0:928e720c71da 5 public:
rob117 2:3c3a6f0b11d2 6 MyClass(double messwert) : _messwert(messwert) //Initialisierungsliste
rob117 2:3c3a6f0b11d2 7 {
rob117 0:928e720c71da 8 }
rob117 2:3c3a6f0b11d2 9
rob117 2:3c3a6f0b11d2 10 void status() //Funktion die den status von Messwert abfragt
rob117 2:3c3a6f0b11d2 11 {
rob117 2:3c3a6f0b11d2 12 printf("%f\n", _messwert);
rob117 2:3c3a6f0b11d2 13
rob117 2:3c3a6f0b11d2 14 }
rob117 2:3c3a6f0b11d2 15
rob117 0:928e720c71da 16 private:
rob117 0:928e720c71da 17 double _messwert;
rob117 0:928e720c71da 18 };
rob117 2:3c3a6f0b11d2 19
rob117 2:3c3a6f0b11d2 20
rob117 1:851c54e0d307 21 MyClass myclass(0);
rob117 2:3c3a6f0b11d2 22
rob117 2:3c3a6f0b11d2 23 int main()
rob117 2:3c3a6f0b11d2 24 {
rob117 2:3c3a6f0b11d2 25 while(1) {
rob117 2:3c3a6f0b11d2 26
rob117 2:3c3a6f0b11d2 27 myclass.status();
rob117 2:3c3a6f0b11d2 28 wait_ms(500);
rob117 2:3c3a6f0b11d2 29 }
rob117 2:3c3a6f0b11d2 30 }
rob117 2:3c3a6f0b11d2 31