uebung3

Dependencies:   mbed

Revision:
0:97326dde09e8
Child:
1:e637acc46823
diff -r 000000000000 -r 97326dde09e8 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Oct 06 17:10:11 2020 +0000
@@ -0,0 +1,37 @@
+#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());
+    }
+}