Dominik Tlapak
/
I2C
V1.0
main.cpp
- Committer:
- Kelrath1984
- Date:
- 2020-10-06
- Revision:
- 2:bc5080fc7926
- Parent:
- 1:e1a54bf8215a
- Child:
- 3:5a3eedf8ad2d
File content as of revision 2:bc5080fc7926:
#include "mbed.h" class MyClass1 { public: MyClass1() : m_messwert(0.0) {} ~MyClass1() {} double getMesswert() { return m_messwert; } private: double m_messwert; }; class I2CSensor { private: char m_data[4]; public: I2CSensor(PinName sda, PinName scl) : i2c(sda, scl) {} ~I2CSensor() {} inline float read(uint8_t adress) { I2C.read(adress,m_data,4,false); return (float)m_data; }; private: I2C i2c; }; int main() { return 0; }