simple serial array test

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
pedro_C
Date:
Thu May 28 22:58:05 2015 +0000
Parent:
0:2786b9d7a210
Commit message:
serial array

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 2786b9d7a210 -r 9a0e9ef94ac6 main.cpp
--- a/main.cpp	Thu May 28 22:56:19 2015 +0000
+++ b/main.cpp	Thu May 28 22:58:05 2015 +0000
@@ -8,7 +8,7 @@
 int x=0;
 
 
-char X_buffer []= {0,0};
+char X_buffer []= {0,0}; //2 item array
 
 
 
@@ -17,7 +17,6 @@
     j=0;
     while(j<=1) {
         X_buffer[j] = pc.getc();
-        //Serial.println(X_buffer[i]);
         j++;
     }
 
@@ -33,7 +32,7 @@
         readSerialString ();
 
 
-        x=atoi(X_buffer);
+        x=atoi(X_buffer); //convert to int
 
         pc.printf("%d\n",x);