Control Stepper via Serial Monitor I would like to control my stepper via serial monitor and unfortunatley the code below did not work. Serial monitor works (Serial.println()), but it does not execute the stepperOne() part. Any ideas why would be awesome. 
Thank you. 

#include &lt;AccelStepper.h&gt;

const int stepPin = 5;
const int dirPin = 4;
const int enPin = 12;

String msg;

unsigned int DEST = 800;
unsigned int SPD = 1600;
unsigned int ACCEL = 1600;
const int TEST = 3;

void setup() {

  pinMode(stepPin,OUTPUT);
  pinMode(dirPin,OUTPUT);
  pinMode(enPin,OUTPUT);
  digitalWrite(enPin,HIGH);
  Serial.begin(9600);  // Start Serial

}

void loop() {

if (Serial.available()&gt;0) {
    msg = "";
    while (Serial.available()) {
      delay(10);
      char tmp = Serial.read();
      // msg += tmp;
     if( tmp!='\r' &amp;&amp; tmp!='\n' ) msg+=tmp; // Does not work either
    }
    msg.replace(" ","");
    if (msg=="G") {
      stepperOne();
      Serial.println("Stepper turned.");
    }
    Serial.flush();
  }
}

void stepperOne() {

  AccelStepper stepper(1,stepPin,dirPin);
  digitalWrite(enPin,LOW);
  stepper.setMaxSpeed(SPD);
  stepper.setAcceleration(ACCEL);
  stepper.move(DEST);
  if (DEST &gt; 0) {
    while ( stepper.distanceToGo() &gt; 0 ) {
      stepper.run();
      }
  digitalWrite(enPin,HIGH);
  }
 }
I found the solution, it was the Arduino, older version R2, the R3 works like a charm. I didn't know that the version could cause so much trouble. But in case someone encounters the same problem R3 did it for me.