Stefan Hutter
/
Hutter_6_10_2020_v3
3. nur Zugewiesen bzw I2C erzeugt
main.cpp@5:15aeb54a9126, 2020-10-06 (annotated)
- Committer:
- Hutzi
- Date:
- Tue Oct 06 17:08:06 2020 +0000
- Revision:
- 5:15aeb54a9126
- Parent:
- 4:0f310f0fa9ac
V3_nur zugewiesen und erzeugt
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Hutzi | 1:2a6f45577cf5 | 1 | |
Hutzi | 1:2a6f45577cf5 | 2 | |
Hutzi | 0:45192de7f4d2 | 3 | #include "mbed.h" |
Hutzi | 0:45192de7f4d2 | 4 | |
Hutzi | 1:2a6f45577cf5 | 5 | // Hutter_6.10.2020_ Aufgabe_1 |
Hutzi | 1:2a6f45577cf5 | 6 | |
Hutzi | 0:45192de7f4d2 | 7 | class TestKlasse{ |
Hutzi | 0:45192de7f4d2 | 8 | |
Hutzi | 0:45192de7f4d2 | 9 | |
Hutzi | 0:45192de7f4d2 | 10 | public: |
Hutzi | 5:15aeb54a9126 | 11 | TestKlasse(PinName sda, PinName scl): _i2c(scl,sda){} |
Hutzi | 5:15aeb54a9126 | 12 | |
Hutzi | 5:15aeb54a9126 | 13 | float read(); |
Hutzi | 4:0f310f0fa9ac | 14 | |
Hutzi | 4:0f310f0fa9ac | 15 | private: |
Hutzi | 5:15aeb54a9126 | 16 | I2C _i2c; |
Hutzi | 5:15aeb54a9126 | 17 | |
Hutzi | 0:45192de7f4d2 | 18 | }; |
Hutzi | 0:45192de7f4d2 | 19 | |
Hutzi | 5:15aeb54a9126 | 20 | TestKlasse i2c(p28,p27); |
Hutzi | 0:45192de7f4d2 | 21 | |
Hutzi | 0:45192de7f4d2 | 22 | int main() { |
Hutzi | 0:45192de7f4d2 | 23 | |
Hutzi | 5:15aeb54a9126 | 24 | ausgabe.gibAus(); |
Hutzi | 0:45192de7f4d2 | 25 | |
Hutzi | 0:45192de7f4d2 | 26 | } |
Hutzi | 0:45192de7f4d2 | 27 | |
Hutzi | 1:2a6f45577cf5 | 28 | |
Hutzi | 1:2a6f45577cf5 | 29 |