test

Dependencies:   LM75B mbed

Files at this revision

API Documentation at this revision

Comitter:
bulmenwt
Date:
Wed Jan 28 07:46:04 2015 +0000
Commit message:
e

Changed in this revision

LM75B.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 2a4ba6a6a881 LM75B.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LM75B.lib	Wed Jan 28 07:46:04 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/neilt6/code/LM75B/#7ac462ba84ac
diff -r 000000000000 -r 2a4ba6a6a881 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jan 28 07:46:04 2015 +0000
@@ -0,0 +1,34 @@
+/*M0-BOARD LPC11U24 VERSION 1.0 WF 01_2015
+BULME Graz / Elektronik
+
+LDR
+
+Datei: WF_LDR_V2/main.cpp
+
+*/
+
+#include "mbed.h"
+ 
+AnalogIn LDR(p16);  // Definition LDR-Eingang
+
+float wert;
+
+Serial pc(USBTX, USBRX); // tx, rx
+// ***** Variablendefinition
+
+// ***** Hauptprogramm 
+int main() {
+    while (1)
+    {
+       wert=(LDR.read_u16()/64)*10;  // Ausgabe des Analogwertes auf 10bit
+       pc.printf("\r%u %f\n",(LDR.read_u16()/64), LDR.read());
+       
+       if (wert <=1) {
+            pc.printf("es ist dunkel !   \r");
+         }    
+        else {
+            pc.printf("es ist hell !   \r");
+           }
+       wait(0.1);   // Warte 100ms
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 2a4ba6a6a881 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jan 28 07:46:04 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1
\ No newline at end of file