Ueberladen1

Dependencies:   mbed

main.cpp

Committer:
happy_alien
Date:
2020-10-13
Revision:
3:bd21a5fcccf0
Parent:
1:211adb1a2b53

File content as of revision 3:bd21a5fcccf0:


#include "mbed.h"

void printWert(void);

class MyClass
{
public:
    MyClass(): _messwert(0){
        _messwert=1;
    }
    MyClass(double messwert):_messwert(messwert)
    {
        
    }
 
  void printWert(){
    printf("Status is now: %f\n", _messwert);
}
void printWert(int izahl){ 
    printf("Wert ist jetzt: %f izahl: %d\n", _messwert,izahl);}

void printWert(int izahl, int anz)
{   
    anz=20;
     printf("Status is now: %f izahl %d anz %d\n", _messwert,izahl,anz);
}
private:
    double _messwert;
};

MyClass messwert(0.0);
MyClass messwert2(2.0);





int main()
{
    while (1) {
        int anzahl=0;

        messwert.printWert();
        wait_ms(500);
        messwert2.printWert();
        wait_ms(500);
        messwert2.printWert(100);
         wait_ms(500);
        messwert2.printWert(100,anzahl);



    }
}
}