Dominik Tlapak
/
I2C
V1.0
main.cpp@0:25699a99e08b, 2020-10-06 (annotated)
- Committer:
- Kelrath1984
- Date:
- Tue Oct 06 16:14:56 2020 +0000
- Revision:
- 0:25699a99e08b
- Child:
- 1:e1a54bf8215a
V1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kelrath1984 | 0:25699a99e08b | 1 | #include "mbed.h" |
Kelrath1984 | 0:25699a99e08b | 2 | |
Kelrath1984 | 0:25699a99e08b | 3 | class MyClass1{ |
Kelrath1984 | 0:25699a99e08b | 4 | public: |
Kelrath1984 | 0:25699a99e08b | 5 | MyClass() : m_messwert(0.0) {} |
Kelrath1984 | 0:25699a99e08b | 6 | ~MyClass() {} |
Kelrath1984 | 0:25699a99e08b | 7 | double getMesswert() {return m_messwert;} |
Kelrath1984 | 0:25699a99e08b | 8 | private: |
Kelrath1984 | 0:25699a99e08b | 9 | double m_messwert; |
Kelrath1984 | 0:25699a99e08b | 10 | }; |
Kelrath1984 | 0:25699a99e08b | 11 | |
Kelrath1984 | 0:25699a99e08b | 12 | class I2CSensor{ |
Kelrath1984 | 0:25699a99e08b | 13 | private: |
Kelrath1984 | 0:25699a99e08b | 14 | DigitalOut m_sda; |
Kelrath1984 | 0:25699a99e08b | 15 | DigitalOut m_scl; |
Kelrath1984 | 0:25699a99e08b | 16 | |
Kelrath1984 | 0:25699a99e08b | 17 | public: |
Kelrath1984 | 0:25699a99e08b | 18 | I2CSensor(PinName sda, PinName scl) : m_sda(sda), m_scl(scl) {} |
Kelrath1984 | 0:25699a99e08b | 19 | ~I2CSensor(){} |
Kelrath1984 | 0:25699a99e08b | 20 | inline float read(){}; |
Kelrath1984 | 0:25699a99e08b | 21 | private: |
Kelrath1984 | 0:25699a99e08b | 22 | I2C i2c(m_sda,m_scl); |
Kelrath1984 | 0:25699a99e08b | 23 | |
Kelrath1984 | 0:25699a99e08b | 24 | }; |
Kelrath1984 | 0:25699a99e08b | 25 | |
Kelrath1984 | 0:25699a99e08b | 26 | |
Kelrath1984 | 0:25699a99e08b | 27 | int main() { |
Kelrath1984 | 0:25699a99e08b | 28 | |
Kelrath1984 | 0:25699a99e08b | 29 | |
Kelrath1984 | 0:25699a99e08b | 30 | |
Kelrath1984 | 0:25699a99e08b | 31 | return 0; |
Kelrath1984 | 0:25699a99e08b | 32 | } |