final

Dependencies:   KS0108 WIZnet_Library mbed

Fork of bigthingRec by rohan gala

Revision:
1:630aef63181c
Parent:
0:98be6bf27557
Child:
2:015a5a76bb82
diff -r 98be6bf27557 -r 630aef63181c main.cpp
--- a/main.cpp	Mon Jun 15 06:55:22 2015 +0000
+++ b/main.cpp	Tue Mar 15 07:39:10 2016 +0000
@@ -1,11 +1,11 @@
 #include "mbed.h"
 #include "stdio.h"        
- DigitalOut myled(LED1);
+DigitalOut myled(LED1);
 Serial pc(USBTX, USBRX);
-Serial micro(PTD3, PTD2); // tx, rx
+Serial micro(PTA2, PTA1); // tx, rx
 char buff[]={'\0'};
 
-int num,val;
+uint8_t val;
  
 int main() 
 {myled = 1;
@@ -16,40 +16,30 @@
      {
       if(micro.readable()) 
       {
-    myled = 0;
-    uint8_t  val=(micro.getc());
-    myled = 1;
     
-    wait(1);
-    
-    myled = 0;
-    uint8_t  num=(micro.getc());
-    myled = 1;
+        myled = 0;
+        val=(micro.getc());
+        
 
-  if(val == 0x01)
-  {
-      printf("The Temperature is : ");
-      pc.putc(num);
-      
-  //pc.putc(val);
-  }
-  
-  
+        if(val == 0x00)
+        {      
+            
+            
+            
+            pc.putc(0x04);
+            
+        }
 
-  if(val == 0x02)
-  {
-      printf("The Lux Value is : ");
-      pc.putc(num);
-      }
+        if(val == 0x01)
+        {      
+           
+            pc.putc(0x09);
+        }
   
-      val=0x00;
-       //   display.PrintInteger(num,3,0);
-       myled = 0;
-       
-    
- //    printf("%d\n\r",x);
-       wait(2);
-       myled=1;
+        val=0x00;
+        
+        wait(2);
+         myled=1;
        }
     }       
  }  
\ No newline at end of file