Puchogenso

Dependencies:   mbed-rtos mbed C12832

Revision:
0:2124db616035
Child:
1:6f592335f935
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Oct 31 17:28:45 2017 +0000
@@ -0,0 +1,37 @@
+/*#include "mbed.h"
+ 
+AnalogOut Aout(p18);
+int *lugar;
+
+int main() {                                                                    //Inicializa los hilos de "pulso" y "calculo"; además, tras cada flanco de subida detectado, envía a la interrupción "cuenta" 
+    //thread.start(triangular);  
+    while(1)
+    {
+    Aout=0.5;
+    wait(.050);
+    Aout=0;
+    wait(.050);
+    }   
+}*/
+
+#include "mbed.h"
+ 
+Timer t;
+int array[5];
+int H[5];
+AnalogOut Aout(p18);
+
+int main () {
+    t.start();
+    while (1) {
+        while (t.read() < 0.5) {
+            for (int i = 0; i<5; i++) {
+                array[i] = i;
+                H[i] = array[i]*2;
+                Aout = array[i]/2;
+                wait(0.1);
+            }
+        }
+        t.reset();
+    }
+}
\ No newline at end of file