Robin Handy
/
initialisierungslisten3
uebung3
main.cpp
- Committer:
- rob117
- Date:
- 2020-10-06
- Revision:
- 1:e637acc46823
- Parent:
- 0:97326dde09e8
File content as of revision 1:e637acc46823:
#include "mbed.h" class MyClassB { public: MyClassB(PinName sda, PinName scl) : i2c(sda, scl){ result = 0; } float read(); private: I2C i2c; float result; }; float MyClassB::read(){ return result; } MyClassB sensor(p28, p27); int main() { while(1) { wait(500); printf("Wert: %f \n", sensor.read()); } }