Programming servo with motion trigger

I am trying to program the servo motor to move 105 degrees and back every time the motion trigger is activated. However, the result is nothing happening. My code is below:

void setup() {
// put your setup code here, to run once:
Serial.begin (9600);
pinMode (0, INPUT);
pinMode (5, OUTPUT);
}

void loop() {
// put your main code here, to run repeatedly:
int sensorValue= analogRead(A0);
if (sensorValue) 1023;
{
analogWrite (150, 5);
}
}

Is there anything noticeably wrong that may be causing nothing to happen. I’m not really sure how to do an “if” statement. Finally, should I have included the code below?

(hashtag)include Servo
Servo myServo;

28 posts were merged into an existing topic: Servo moves inconsistent amounts (time-sensitive)