This program send an AT command to the HC05 module and shows the response into a terminal.

Dependencies:   mbed-src MODSERIAL

Notebook page HERE

Files at this revision

API Documentation at this revision

Comitter:
edodm85
Date:
Sat Oct 19 12:02:30 2013 +0000
Parent:
2:08505f23f37a
Child:
4:54c1dc468534
Commit message:
Added clear buffer

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Oct 18 21:31:21 2013 +0000
+++ b/main.cpp	Sat Oct 19 12:02:30 2013 +0000
@@ -76,6 +76,7 @@
                 i++;
             }
             commandAT(ATCmd);
+            memset(ATCmd, 0, sizeof(ATCmd));
             new_send = false;
         }else
         if(new_response)
@@ -86,7 +87,8 @@
                 blueChar[i] = blue.getc();
                 i++;
             }
-            printf("Response: %s", blueChar);  
+            printf("Response: %s", blueChar); 
+            memset(blueChar, 0, sizeof(blueChar)); 
             new_response = false;   
         }    
         wait_ms(100);