Codeschnippseln für diese Übung

Dependencies:   mbed

main.cpp

Committer:
Aagrus
Date:
2020-10-06
Revision:
0:76d9c940a794
Child:
1:c65875995efb

File content as of revision 0:76d9c940a794:

#include "mbed.h"


class MyClassB
{
    private:
        I2C i2c;
        float result;
        
    public:
      MyClassB(PinName sda, PinName scl) : i2c(sda, scl)
      {
          result = 0;
      }
      float read();
};

float MyClassB::read() { return result; }
 
 
 
MyClassB sensor(p28, p27);

int main()
{
    float x = sensor.read();
}