fix compatibility between identification and arcs
authorMjolnir <thomas.pietrzak@inria.fr>
Fri, 4 Sep 2015 09:44:03 +0000 (11:44 +0200)
committerMjolnir <thomas.pietrzak@inria.fr>
Fri, 4 Sep 2015 09:44:03 +0000 (11:44 +0200)
GCodeParser/GCodeParser.ino
GCodeParser/process_string.ino

index b9f755b4a5032325711510224ef69314b6cf8796..b4ce07db7b346ca856846ceee7a99c612ef880ea 100644 (file)
@@ -116,7 +116,7 @@ void loop()
     else if (serial_count < COMMAND_SIZE)
     {
       commands[serial_count] = c;
-      serial_count++
+      serial_count++;
     }
   }
   else
index 9033296934ee6152bd891fe43a453026d0598a1b..82dcc736c24a7caf73e37a98fb17cb0af157f564 100644 (file)
@@ -65,14 +65,13 @@ void process_string(char instruction[], int size)
        
         
        //did we get a gcode?
-        if (has_command('I', instruction, size))
-        {
+        if (instruction[0] == 'I')
           Serial.println(F("XYPlotter"));
-        }
-        else if (has_command('C', instruction, size))
+        else if (instruction[0] ==  'C')
         {
           init_steppers();
           process_string("G90",3);//Absolute Position
+          process_string("G21",3);//mm units
         }
        else if (!has_command('$', instruction, size)&&(
                has_command('G', instruction, size) ||