muestra en el Tera Tem datos del contol

Dependencies:   Pulse1 TextLCD mbed

Fork of irda_V_aula by Gustavo Ramirez

Files at this revision

API Documentation at this revision

Comitter:
jana
Date:
Wed Oct 29 15:47:03 2014 +0000
Parent:
3:82bebaf2a06a
Commit message:
observar los datos del control por Tera Term

Changed in this revision

TextLCD.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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Wed Oct 29 15:47:03 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#308d188a2d3a
--- a/main.cpp	Thu May 08 00:38:39 2014 +0000
+++ b/main.cpp	Wed Oct 29 15:47:03 2014 +0000
@@ -1,20 +1,31 @@
 #include "mbed.h"
 #include <Pulse1.h>
+#include "TextLCD.h"
+
+TextLCD lcd(PTB10, PTB11, PTE2, PTE3, PTE4, PTE5); //Puertos LCD rs, e, d4, d5, d6, d7
+
 //control remoto videobeam aula
 PulseInOut irda(PTD5);// en este puerto se pone el sensor infrarrojo
 Serial pc(USBTX, USBRX);
 DigitalOut led(LED1);
 DigitalOut led2(LED2);
+DigitalOut led1(LED3);
+
 int header =0; //tiempo de cabecera pulso abajo
-const int head_H = 9120; //+10% medida con osciloscopio en microsegundos
-const int head_L = 8939;//-10%  medida con osciloscopio
+const int head_H = 5000; //+10% medida con osciloscopio en microsegundos
+const int head_L = 4530;//+10%medida con osciloscopio
 int i=0;
-const int T_alto=1630;//ponga su tiempo de la prueba
-const int T_bajo=533;//ponga su tiempo de la prueba
-const int num_bits = 64;//ponga su numero de bits
+const int T_alto=1600;//ponga su tiempo de la prueba
+const int T_bajo=500;//ponga su tiempo de la prueba
+const int num_bits = 50;//nga su numero de bits
 int num[num_bits];//cadena para almacenar todos los tiempos que conforman los bits de datos
 int dato; // tiempo de cada dato que se lee
-  
+
+int num1[] = {0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0};
+int numb[num_bits];
+int suma;
+
+
 int main(){
 while(1){
 ini1: fflush( stdin );
@@ -43,7 +54,10 @@
       pc.printf("\n\n");
       for(i=0;i<(num_bits-1);++i){  
       if(num[i] > ((T_alto+T_bajo)/2)) pc.printf("1");
-      else pc.printf("0");
+      else { pc.printf("0");
       }
+      
+       }    
+      
       }
       }
\ No newline at end of file