arduino X piano tiles

I’m making a machine that plays piano tiles itself. So I made a sketch for it. But it doesn’t work! I think it’s not a hardware problem but a software. Please look at my sketch and find the problem. And sorry for my poor English ability:)

#include <Servo.h>
Servo servo1;
Servo servo2;
Servo servo3;
Servo servo4;
int lightsensor1=A1;
int lightsensor2=A2;
int lightsensor3=A3;
int lightsensor4=A4;
void setup() {
servo1.attach(1);
servo2.attach(2);
servo3.attach(3);
servo4.attach(4);
pinMode(lightsensor1,INPUT);
pinMode(lightsensor2,INPUT);
pinMode(lightsensor3,INPUT);
pinMode(lightsensor4,INPUT);
}

void loop() {
int sensorValue1=analogRead(lightsensor1);
int sensorValue2=analogRead(lightsensor2);
int sensorValue3=analogRead(lightsensor3);
int sensorValue4=analogRead(lightsensor4);
if(sensorValue1<20){servo1.write(50);delay(1);servo1.write(0);}
if(sensorValue2<20){servo2.write(50);delay(1);servo2.write(0);}
if(sensorValue3<20){servo3.write(50);delay(1);servo3.write(0);}
if(sensorValue4<20){servo4.write(50);delay(1);servo4.write(0);}
}

But it doesn’t work!

That’s the lamest thing you could possibly post here.

What does “work” mean in this context?
How does that definition differ from what you obsere.

And use CODE TAGS

I think it’s not a hardware problem

You’re the only one who thinks that because you haven’t given anyone else enough information to form an opinion.

That delay(1) doesn't give the servo very long to move.

pinMode(lightsensor1,INPUT);
pinMode(lightsensor2,INPUT);
pinMode(lightsensor3,INPUT);
pinMode(lightsensor4,INPUT);

It is pointless to diddle with the digital nature of a pin being used as an analog pin.