help needed - monitoring sensor and add 4 servo motor

I've already done this code for 4 PIR sensors monitoring, and now I want to add 4 servo motor to be controlled with the GUI in visual studio. how can I do this? is anybody can help me for the code? thank for your all help...

this is my code for arduino. I cant make the visual studio one..

const int sensorread = A0;
const int sensorread1 = A1;
const int sensorread2 = A2;
const int sensorread3 = A3;

void setup()
{
Serial.begin(9600);
pinMode(sensorread, INPUT);
pinMode(sensorread1, INPUT);
pinMode(sensorread2, INPUT);
pinMode(sensorread3, INPUT);

}

void loop()
{
int counter = 0;
int counter1 = 0;
int counter2 = 0;
int counter3 = 0;

byte state;
byte state1;
byte state2;
byte state3;

byte laststate;
byte laststate1;
byte laststate2;
byte laststate3;

laststate = digitalRead(sensorread); // Pre-load last state
laststate1 = digitalRead(sensorread1);
laststate2 = digitalRead(sensorread2);
laststate3 = digitalRead(sensorread3);
Serial.println("Begin...");
unsigned long startTime = millis(); // Get current chip time
while((startTime + 30000) > millis())
{
state = digitalRead(sensorread);
state1 = digitalRead(sensorread1);
state2 = digitalRead(sensorread2);
state3 = digitalRead(sensorread3);
if (state != laststate)
{
counter++; // Increments twice per drop so divide by 2 to get true count
laststate = state;
Serial.print(".");
delay (30); // Debounce
}

if (state1 != laststate1)
{
counter1++; // Increments twice per drop so divide by 2 to get true count
laststate1 = state1;
Serial.print(".");
delay (30); // Debounce
}

if (state2 != laststate2)
{
counter2++; // Increments twice per drop so divide by 2 to get true count
laststate2 = state2;
Serial.print(".");
delay (30); // Debounce
}

if (state3 != laststated3)
{
counter3++; // Increments twice per drop so divide by 2 to get true count
laststate3 = state3;
Serial.print(".");
delay (30); // Debounce
}
}

char on_sensor = 'n';
if (Serial.available()>0)
{
on_sensor = Serial.read();
}

if (on_sensor == 'a')
{
Serial.println (counter/2);
}

if (on_sensor == 'b')
{
Serial.println (counter1/2);
}

if (on_sensor == 'c')
{
Serial.println (counter2/2);
}

if (on_sensor == 'd')
{
Serial.println (counter3/2);
}
}

That means you need visual studio code where you send command Serially to enable servo motor??

Have you checked the below code working fine or Not??