BIGTHING

Dependencies:   KS0108 mbed

Revision:
0:98be6bf27557
Child:
1:630aef63181c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Jun 15 06:55:22 2015 +0000
@@ -0,0 +1,55 @@
+#include "mbed.h"
+#include "stdio.h"        
+ DigitalOut myled(LED1);
+Serial pc(USBTX, USBRX);
+Serial micro(PTD3, PTD2); // tx, rx
+char buff[]={'\0'};
+
+int num,val;
+ 
+int main() 
+{myled = 1;
+      //  wait(3);
+        
+
+     while(1) 
+     {
+      if(micro.readable()) 
+      {
+    myled = 0;
+    uint8_t  val=(micro.getc());
+    myled = 1;
+    
+    wait(1);
+    
+    myled = 0;
+    uint8_t  num=(micro.getc());
+    myled = 1;
+
+  if(val == 0x01)
+  {
+      printf("The Temperature is : ");
+      pc.putc(num);
+      
+  //pc.putc(val);
+  }
+  
+  
+
+  if(val == 0x02)
+  {
+      printf("The Lux Value is : ");
+      pc.putc(num);
+      }
+  
+      val=0x00;
+       //   display.PrintInteger(num,3,0);
+       myled = 0;
+       
+    
+ //    printf("%d\n\r",x);
+       wait(2);
+       myled=1;
+       }
+    }       
+ }  
\ No newline at end of file