user20381: I wrote this simple script to control a servo over serial comm - 
#include <Servo.h>
Servo steeringServo;
char data = ' ';

void setup() {
  steeringServo.attach(9);
  Serial.begin(115200);

}

void loop() {
  if(Serial.available()){
    data = Serial.read();
  }

  if(data =='L'){
    steeringServo.write(50);
  }
  else if(data == 'R'){
    steeringServo.write(135);
  }
  else if(data == 'S'){
    steeringServo.write(90);
  }


}

It was working fine, I was sending values through a python script. I turned my Arduino off and after a while I come back and reconnect all stuff exactly the way it was, but now my Arduino isn't responding! I tried sending values through the serial monitor to the above sketch but nothing happens! I tried another code which takes values over serial comm and that didn't work as well. The Arduino just receives the values but doesn't do what its supposed to when it receives.
Not only this, I tried uploading the sweep sketch and that didn't work either. Everything is connected exactly the way it was when stuff was fine.
What has gone wrong with my Arduino?
UPDATE
The Arduino works fine if the values are sent through my script.
UPDATE 2
The Arduino works fine if the values are sent through puTTY.

user-1: You never reset data. Every time you enter loop, data keep the last value you read.
You don't need to test data in every loop, only after you read something:
void loop()
{
    if(Serial.available()) {
        data = Serial.read();

        if(data =='L') {
            steeringServo.write(50);
        } else if(data == 'R') {
            steeringServo.write(135);
        } else if(data == 'S') {
            steeringServo.write(90);
        }
    }

I'm afraid that there are additional problems with the servo library: some implementations (looking at Servo-master) disable interrupts, which mess with your Serial port. 

20381: <p>I wrote this simple script to control a servo over serial comm - </p>

<pre><code>#include &lt;Servo.h&gt;
Servo steeringServo;
char data = ' ';

void setup() {
  steeringServo.attach(9);
  Serial.begin(115200);

}

void loop() {
  if(Serial.available()){
    data = Serial.read();
  }

  if(data =='L'){
    steeringServo.write(50);
  }
  else if(data == 'R'){
    steeringServo.write(135);
  }
  else if(data == 'S'){
    steeringServo.write(90);
  }


}
</code></pre>

<p>It was working fine, I was sending values through a python script. I turned my Arduino off and after a while I come back and reconnect all stuff exactly the way it was, but now my Arduino isn't responding! I tried sending values through the serial monitor to the above sketch but nothing happens! I tried another code which takes values over serial comm and that didn't work as well. The Arduino just receives the values but doesn't do what its supposed to when it receives.</p>

<p>Not only this, I tried uploading the sweep sketch and that didn't work either. Everything is connected exactly the way it was when stuff was fine.</p>

<p>What has gone wrong with my Arduino?</p>

<p><strong>UPDATE</strong><br>
The Arduino works fine if the values are sent through my script.</p>

<p><strong>UPDATE 2</strong><br>
The Arduino works fine if the values are sent through puTTY.</p>
 -1: <p>You never reset <code>data</code>. Every time you enter <code>loop</code>, data keep the last value you read.</p>

<p>You don't need to test <code>data</code> in every <code>loop</code>, only after you read something:</p>

<pre><code>void loop()
{
    if(Serial.available()) {
        data = Serial.read();

        if(data =='L') {
            steeringServo.write(50);
        } else if(data == 'R') {
            steeringServo.write(135);
        } else if(data == 'S') {
            steeringServo.write(90);
        }
    }
</code></pre>

<p>I'm afraid that there are additional problems with the servo library: some implementations (looking at Servo-master) disable interrupts, which mess with your Serial port. </p>
