Seeker of Truth , / Mbed 2 deprecated slave_1

Dependencies:   mbed

Fork of slave_1 by sakthi priya amirtharaj

Revision:
2:ba6aa46cd931
Parent:
1:afb4a0df7ff1
--- a/main.cpp	Sun Dec 07 07:38:30 2014 +0000
+++ b/main.cpp	Mon Dec 08 03:57:31 2014 +0000
@@ -15,14 +15,25 @@
     char *command = new char;   
     slave.address(0x20);
     int slave_status =1;
-    slave.stop();
-    while(slave.receive()!=3);
-    while(slave_status)
+    //slave.stop();
+    //while(slave.receive()!=3);
+    
+    while(slave_status) 
+    {
+        
+        
         slave_status=slave.read(command,1);
-    printf("\nread %c from master\n\r",*command);
-    execute_command(command);   //assumed command is very important
+        
+    }
+    
+    
+    printf("\nread %c from master\n\r",command);
+    execute_command(command); 
+      //assumed command is very important
     printf("\n done \n \r");
     delete command;
+    
+    
 }
 
 void execute_command(char* cmd)
@@ -50,6 +61,6 @@
     m2s_interrupt.rise(&read_command);
     while(1)
     {
-        ;
+       
     }
 }
\ No newline at end of file