Codeschnippseln für diese Übung

Dependencies:   mbed

main.cpp

Committer:
Aagrus
Date:
2020-10-13
Revision:
1:c65875995efb
Parent:
0:76d9c940a794
Child:
2:7a0bae2281e8

File content as of revision 1:c65875995efb:

#include "mbed.h"
#include "class4.cpp"

class MyClassB
{
    private:
        I2C i2c;
        float _result;
        
    public:
      MyClassB(I2C& i2cCopy) : i2c(i2cCopy)
      {
          //c = i2cCopy;
          _result = 0;
      }
      MyClassB(PinName sda, PinName scl) : i2c(sda, scl)
      {
          _result = 0;
      }
      
      float Read();
};

float MyClassB::Read() { return _result; }
 
 
 



Serial pc(USBTX, USBRX);
MyPrintClass printClass(&pc);

int main()
{
    int x[] = { 1, 4, 7, 3, 10, 20 };
    char s[] = "Hallo Welt!";
    
    while (1) 
    {
        printClass.PrintString(s, sizeof(s));
        printClass.PrintIntValues(68);
        printClass.PrintIntValues(x, sizeof(x) / sizeof(int));
        
        wait(500);
    }
}