Dominik Tlapak
/
I2C
V1.0
Diff: main.cpp
- Revision:
- 2:bc5080fc7926
- Parent:
- 1:e1a54bf8215a
- Child:
- 3:5a3eedf8ad2d
diff -r e1a54bf8215a -r bc5080fc7926 main.cpp --- a/main.cpp Tue Oct 06 16:56:19 2020 +0000 +++ b/main.cpp Tue Oct 06 16:57:27 2020 +0000 @@ -15,12 +15,16 @@ class I2CSensor { - private - char m_data[4]; +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;}; + inline float read(uint8_t adress) + { + I2C.read(adress,m_data,4,false); + return (float)m_data; + }; private: I2C i2c;