This program simply connects to a HTS221 I2C device to proximity sensor

Dependencies:   FXOS8700CQ mbed

Revision:
6:713b4cbf1a7d
Parent:
5:3417b6a84ee3
Child:
8:b08ec94d9e9f
--- a/main.cpp	Mon Jul 11 21:34:31 2016 +0000
+++ b/main.cpp	Mon Jul 11 22:05:34 2016 +0000
@@ -168,14 +168,20 @@
 }
 
 int mdm_sendAtCmdRsp(const char *cmd, const char **rsp_list, int timeout_ms, string * rsp, int * len) {
-
     static char cmd_buf[3200];  // Need enough room for the WNC sockreads (over 3000 chars)
-
-    if (cmd && strlen(cmd) > 0) {
+    size_t n = strlen(cmd);
+    if (cmd && n > 0) {
         if (mdm_dbgmask & MDM_DBG_AT_CMDS) {
             printf(MAG "ATCMD: " DEF "--> " GRN "%s" DEF "\n", cmd);
         }
-        mdm.printf("%s\r\n", cmd);
+        while (n--) {
+            mdm.putc(*cmd++);
+            wait_ms(1);
+        };
+        mdm.putc('\r');
+        wait_ms(1);
+        mdm.putc('\n');
+        wait_ms(1);
     }
 
     if (rsp_list) {