Huseyin Berkay Berabi / GA-Final

Dependencies:   mbed-dev

Fork of GA-Berkay_Alex by Alejandro Ungria Hirte

Revision:
1:346279def7ac
Parent:
0:a3b83d366423
Child:
3:8bee1711d186
--- a/PC/PC.cpp	Wed Dec 06 21:35:45 2017 +0000
+++ b/PC/PC.cpp	Sat Dec 09 16:02:58 2017 +0000
@@ -25,29 +25,30 @@
 void PC::readcommand(void (*executer)(char*))
 {
     
-/*
-    char input = getc();             // get the character from serial bus
+
+    /*char input = getc();             // get the character from serial bus
     //printf("\x1B[1K");
     //printf("-");
-    if(input == '\r') {                 // if return was pressed, the command must be executed
+    if(input == 'r') {                 // if return was pressed, the command must be executed
         command[command_char_count] = '\0';
         executer(&command[0]);
-        printf("Debug Point 5");
-        //printf("1");
         command_char_count = 0;                 // reset command
         command[command_char_count] = '\0';
-       // printf("2");
     } else if (command_char_count < COMMAND_MAX_LENGHT) {
-        printf("Debug Point 4");
+       // printf("Debug Point 4");
         command[command_char_count] = input;
+        //printf(command);
         command_char_count++;
     }
+
 */
 
 
-
-    while (1)
+    
+   
+   while (1)
     {
+       
         if (readable())
         {
             scanf( "%s" , command );
@@ -58,6 +59,10 @@
    
     
     executer(&command[0]);
+    command_char_count = 0;                 // reset command
+    
+    
+
 
 
 }