test de TSL230 circuit conversion lumière/frequence

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
bouaziz
Date:
Wed Oct 19 18:56:53 2011 +0000
Parent:
0:94a3a01d13c2
Commit message:
version test

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 94a3a01d13c2 -r 0ef745d284a1 main.cpp
--- a/main.cpp	Thu Oct 13 22:24:09 2011 +0000
+++ b/main.cpp	Wed Oct 19 18:56:53 2011 +0000
@@ -17,6 +17,7 @@
 
 
 #include "mbed.h"
+#include "math.h"
 
 
 Serial pc(USBTX, USBRX);
@@ -33,7 +34,7 @@
                t.start();
                n++;
                break;
-      case 1 : 
+     // case 1 : 
       case 10: t.stop();
                per=t.read_us();
                n=0;
@@ -51,14 +52,15 @@
 
 
 int main() {
-
+float mes;
 //    in.mode(PullUp); // Set the pin to Pull Down mode.
     in.rise(&itup);  // Set up the interrupt for rising edge
 //    in.fall(&itdown);  // Set up the interrupt for rising edge
     while (1) {
         wait(1);
         //freq= 100000.0/((float)per);
-        pc.printf("val= %f \r",1000000./(float)per);
+        mes=(10000./((float)per))/0.0069;
+        pc.printf("%f %f\r\n",mes,10000000./((float)per));
 
     }
 }