Sensor

Dependencies:   TSI mbed

Files at this revision

API Documentation at this revision

Comitter:
darkmx4
Date:
Thu Oct 31 00:32:38 2013 +0000
Commit message:
Sensor
; No funciona

Changed in this revision

TSI.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 033223937706 TSI.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TSI.lib	Thu Oct 31 00:32:38 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/vsluiter/code/TSI/#4dc2f5a3a731
diff -r 000000000000 -r 033223937706 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Oct 31 00:32:38 2013 +0000
@@ -0,0 +1,121 @@
+
+#include "mbed.h"
+#include "TSISensor.h"
+
+#define TSISENSOR_H
+
+DigitalOut rojo(PTD4);
+DigitalOut rojo2(PTA12);
+DigitalOut rojo3(PTA4);
+DigitalOut rojo4(PTA5);
+DigitalOut rojo5(PTC8);
+DigitalOut rojo6(PTC9);
+DigitalOut rojo7(PTA13);
+DigitalOut amarillo(PTD5);
+TSISensor tsi;
+
+int x;
+
+int main(void) {
+    while(1) {
+    
+    x = tsi.readPercentage();
+    
+        if(x <=0.125)
+        {
+        rojo = 0;
+        rojo2 = 1;
+        rojo3 = 1;
+        rojo4 = 1;
+        rojo5 = 1;
+        rojo6 = 1;
+        rojo7 = 1;
+        amarillo = 1;
+        }
+        else
+            if(x<=0.25)
+            {
+            rojo = 1;
+        rojo2 = 0;
+        rojo3 = 1;
+        rojo4 = 1;
+        rojo5 = 1;
+        rojo6 = 1;
+        rojo7 = 1;
+        amarillo = 1;
+            }
+            else
+                if(x<=0.375)
+                {
+                rojo = 1;
+        rojo2 = 1;
+        rojo3 = 0;
+        rojo4 = 1;
+        rojo5 = 1;
+        rojo6 = 1;
+        rojo7 = 1;
+        amarillo = 1;
+                }
+                else
+                    if(x<=0.5)
+                    {
+                    rojo = 1;
+        rojo2 = 1;
+        rojo3 = 1;
+        rojo4 = 0;
+        rojo5 = 1;
+        rojo6 = 1;
+        rojo7 = 1;
+        amarillo = 1;
+                    }
+                    else
+                        if(x<=0.625)
+                        {
+                        rojo = 1;
+        rojo2 = 1;
+        rojo3 = 1;
+        rojo4 = 1;
+        rojo5 = 0;
+        rojo6 = 1;
+        rojo7 = 1;
+        amarillo = 1;
+                        }  
+                        else
+                            if(x<=0.75)
+                            {
+                            rojo = 1;
+        rojo2 = 1;
+        rojo3 = 1;
+        rojo4 = 1;
+        rojo5 = 1;
+        rojo6 = 0;
+        rojo7 = 1;
+        amarillo = 1;  
+                            }
+                            else
+                                if(x<=0.875)
+                                {
+                                rojo = 1;
+        rojo2 = 1;
+        rojo3 = 1;
+        rojo4 = 1;
+        rojo5 = 1;
+        rojo6 = 1;
+        rojo7 = 0;
+        amarillo = 1;   
+                                }
+                                else
+                                    if(x>=0.876)
+                                    {
+                                    rojo = 1;
+        rojo2 = 1;
+        rojo3 = 1;
+        rojo4 = 1;
+        rojo5 = 1;
+        rojo6 = 1;
+        rojo7 = 1;
+        amarillo = 0;
+        }
+      }  
+    }
+
diff -r 000000000000 -r 033223937706 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Oct 31 00:32:38 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file