title: Converting ASCII to int in Arduino
body: <p>I am trying to get user input from the serial monitor to turn a stepper motor according to the input. However my code returns the ASCII value rather than the original input.</p>
  
  <pre><code>#include &lt;Stepper.h&gt;
  
  Stepper small_stepper(steps_per_motor_revolution, 8, 10, 9, 11);
  
  void setup() {
    // Put your setup code here, to run once:
    Serial.begin(9600);
    Serial.println("Ready");
  }
  
  
  void loop() {
  
    // Put your main code here, to run repeatedly:
    int Steps2Take = Serial.read();
    Serial.println(Steps2Take); // Printing
    if (Steps2Take == -1)
      Steps2Take = 0;
    else {
      small_stepper.setSpeed(1000); // Setting speed
      if (Steps2Take &gt; 0)
        small_stepper.step(Steps2Take * 32);
      else
        small_stepper.step(-Steps2Take * 32);
      delay(2);
    }
  }
  </code></pre>