program to send data to MCU xpresso

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Niranjan_ravi
Date:
Thu May 02 23:23:36 2019 +0000
Commit message:
Program to send data to MCU xpresso

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu May 02 23:23:36 2019 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+#include "math.h"
+#include <string.h>
+
+Serial pc(USBTX, USBRX);
+Serial sendingData(PTC17, PTC16);
+Serial receivingData(PTD3,PTD2);
+char        message[] = "coap CON GET fd61:7409:e1d2:56f2:587f:c682:5d9c:6951 /temp\n";
+char data[2];
+char command[80];
+
+int main()
+{
+   pc.baud(115200);
+   sendingData.baud(115200);
+   receivingData.baud(115200);
+   sendingData.printf("%s", message);
+   while(1)
+   {
+       if (sendingData.readable())
+        {
+            sendingData.gets(command, 80);
+        }   
+       uint8_t i = command[64];
+       uint8_t j = command[65];
+       printf("%c" , i);
+       printf("%c" , j);
+       for(int k = 0; k < 1 ; k++)
+       {
+           data[k]=command[64];
+           k++;
+           data[k]=command[65];
+       }     
+       receivingData.puts(data); //FormatToSend  
+    }  
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu May 02 23:23:36 2019 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e7ca05fa8600
\ No newline at end of file