Dominik Tlapak
/
I2C
V1.0
main.cpp
- Committer:
- Kelrath1984
- Date:
- 2020-10-06
- Revision:
- 1:e1a54bf8215a
- Parent:
- 0:25699a99e08b
- Child:
- 2:bc5080fc7926
File content as of revision 1:e1a54bf8215a:
#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; }