4-10-2015 BAE_RTOS_TEST ACS_DATA_ACQ and I2C sending 25 bytes to CDMS

Dependencies:   mbed-rtos mbed

Fork of BAE_RTOS_test_1 by GOPA KUMAR K C

Files at this revision

API Documentation at this revision

Comitter:
gkumar
Date:
Sun Oct 04 07:24:39 2015 +0000
Parent:
1:b8c71afbe6e5
Commit message:
4-10-2015 BAE_RTOS_TEST2

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r b8c71afbe6e5 -r f26706e0d779 main.cpp
--- a/main.cpp	Sun Oct 04 07:06:22 2015 +0000
+++ b/main.cpp	Sun Oct 04 07:24:39 2015 +0000
@@ -147,7 +147,7 @@
 
 bool write_ack = 1;
 bool read_ack = 1;
-char data_send[10];
+char data_send[25];
 char data_receive[10];
 char short_tc[10];
 char long_tc[134];
@@ -181,7 +181,15 @@
             read_ack=slave.read(data_receive,length);
             t1.stop();
             if(read_ack == 0)
-            printf("\n\r Data received from CDMS is %s \n",data_receive);
+            printf("\n\r Data received from CDMS is %c \n",data_receive);
+            if(strcmp(data_receive,"h"))
+            {   strcpy(data_send, "ababababababababababababg");
+                length=25;
+                write_ack=slave.write(data_send,length);
+                if(write_ack == 0)
+                printf("\n\rData sent to CDMS is %s \n",data_send);     
+                slave.stop();    
+                }
             slave.stop();
         }   
         printf("\n \r %d %d\n",t.read_us(),t1.read_us());