clean
authorMjolnir <thomas.pietrzak@inria.fr>
Wed, 2 Sep 2015 13:52:09 +0000 (15:52 +0200)
committerMjolnir <thomas.pietrzak@inria.fr>
Wed, 2 Sep 2015 13:52:09 +0000 (15:52 +0200)
GCodeParser/GCodeParser.ino

index 7eaad3255307f3b92615d473ebc10bce2546acfc..b9f755b4a5032325711510224ef69314b6cf8796 100644 (file)
@@ -95,9 +95,6 @@ void setup()
   }
   //other initialization.
   init_process_string();
-  //init_steppers();
-  //process_string("G90",3);//Absolute Position
-  //Serial.println("start");
 }
 
 void loop()
@@ -119,79 +116,10 @@ void loop()
     else if (serial_count < COMMAND_SIZE)
     {
       commands[serial_count] = c;
-      serial_count++;
+      serial_count++
     }
   }
   else
     delayMicroseconds(100);
 }
 
-
-/*
-void loop()
-{
-
-  char c;
-  //read in characters if we got them.
-  if (Serial.available() > 0)
-  {
-    c = Serial.read();
-    no_data = 0;
-    //newlines are ends of commands.
-    if (c != '\n')
-    {
-      if (c == 'I')
-        Serial.println(F("XYPlotter"));
-      else if (c == 'C')
-      {
-        init_steppers();
-        process_string("G90",3);//Absolute Position
-      }
-      else
-      {
-        if (c == '(')
-          comment = true;
-
-        // If we're not in comment mode, add it to our array.
-        if (!comment)
-        {
-          commands[serial_count] = c;
-          serial_count++;
-        }
-        if (c == ')')
-          comment = false; // End of comment - start listening again
-      }
-
-    }
-  }
-  else
-  {
-    no_data++;
-    delayMicroseconds(100);
-
-    //if theres a pause or we got a real command, do it
-    if (serial_count && (c == '\n' || no_data > 100))
-    {
-      //process our command!
-      process_string(commands, serial_count);
-      //clear command.
-      init_process_string();
-    }
-
-    //no data?  turn off steppers
-    if (no_data > 1000){
-      disable_steppers();
-    }
-  }
-  //        return;
-  //                delay(5);
-  //                int dPos = abs(currentPosServo-targetPosServo);
-  //                if(currentPosServo<targetPosServo){
-  //                   currentPosServo += dPos>8?6:1;
-  //                }else if(currentPosServo>targetPosServo){
-  //                   currentPosServo -= dPos>8?6:1;
-  //                }
-
-
-}*/
-