PoE Elevator Code

Hello! I am a student in Principles of Engineering. I am currently trying to program the Elevator for project 3.1.7 Machine Control Design. Our design consists of a belt and sprocket system that pulls a small metal object that is our elevator to three different floors. We have two sonar sensors, one at the top, and one at the bottom. We have designed this code at the bottom but the program has no effect on the robot. Any suggestions would be greatly appreciated!
#pragma config(Sensor, dgtl1, limitSwitchOne, sensorTouch)
#pragma config(Sensor, dgtl2, limitSwitchTwo, sensorTouch)
#pragma config(Sensor, dgtl3, limitSwitchThree, sensorTouch)
#pragma config(Sensor, dgtl4, greenOne, sensorLEDtoVCC)
#pragma config(Sensor, dgtl5, greenTwo, sensorLEDtoVCC)
#pragma config(Sensor, dgtl6, greenThree, sensorLEDtoVCC)
#pragma config(Sensor, dgtl7, sonar, sensorSONAR_inch)
#pragma config(Sensor, dgtl9, sonarTwo, sensorSONAR_inch)
#pragma config(Motor, port2, motorOne, tmotorVex393_MC29, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//

/*
Project Title:3.1.7 Machine Control Project
Section:Principles of Engineering

Task Description:

Pseudocode:

*/

task main()
{ //Program begins, insert code within curly bracesc
int ok;
int going;
ok=0;
going=0;
while(1 ==1)
{
if(going <=100)
{
if(SensorValue(limitSwitchOne)==1)
{
if(SensorValue(sonarTwo)==5)
{
startMotor(motorOne, 12);
ok=ok+1;
if(SensorValue(sonar)==5)
{
stopMotor(motorOne);
turnLEDOn(greenOne);
wait(1);
turnLEDOff(greenOne);
wait(1);
turnLEDOn(greenOne);
wait(1);
turnLEDOff(greenOne);
wait(1);
turnLEDOn(greenOne);
wait(5);
turnLEDOff(greenOne);
ok=ok-1;
going=going0;
}
}
if(SensorValue(sonarTwo)==2)
{
startMotor(motorOne, 12);
ok=ok+1;
if(SensorValue(sonar)==5)
{
stopMotor(motorOne);
turnLEDOn(greenOne);
wait(1);
turnLEDOff(greenOne);
wait(1);
turnLEDOn(greenOne);
wait(1);
turnLEDOff(greenOne);
wait(1);
turnLEDOn(greenOne);
wait(5);
turnLEDOff(greenOne);
ok=ok-1;
going=going
0;
}
}
}
if(SensorValue(limitSwitchTwo)==1)
{
if(SensorValue(sonar)==5)
{
startMotor(motorOne, -12);
ok=ok+1;
if(SensorValue(sonarTwo)==5)
{
stopMotor(motorOne);
turnLEDOn(greenTwo);
wait(1);
turnLEDOff(greenTwo);
wait(1);
turnLEDOn(greenTwo);
wait(1);
turnLEDOff(greenTwo);
wait(1);
turnLEDOn(greenTwo);
wait(5);
turnLEDOff(greenTwo);
ok=ok-1;
going=going0;
}
}
if(SensorValue(sonarTwo)==2)
{
startMotor(motorOne, 12);
ok=ok+1;
if(SensorValue(sonarTwo)==5)
{
stopMotor(motorOne);
turnLEDOn(greenTwo);
wait(1);
turnLEDOff(greenTwo);
wait(1);
turnLEDOn(greenTwo);
wait(1);
turnLEDOff(greenTwo);
wait(1);
turnLEDOn(greenTwo);
wait(5);
turnLEDOff(greenTwo);
ok=ok-1;
going=going
0;
}
}
}
if(SensorValue(limitSwitchThree)==1)
{
if(SensorValue(sonar)==5)
{
startMotor(motorOne, -12);
ok=ok+1;
if(SensorValue(sonarTwo)==2)
{
stopMotor(motorOne);
turnLEDOn(greenThree);
wait(1);
turnLEDOff(greenThree);
wait(1);
turnLEDOn(greenThree);
wait(1);
turnLEDOff(greenThree);
wait(1);
turnLEDOn(greenThree);
wait(5);
turnLEDOff(greenThree);
ok=ok-1;
going=going0;
}
}
if(SensorValue(sonarTwo)==5)
{
startMotor(motorOne, -12);
ok=ok+1;
if(SensorValue(sonarTwo)==2)
{
stopMotor(motorOne);
turnLEDOn(greenThree);
wait(1);
turnLEDOff(greenThree);
wait(1);
turnLEDOn(greenThree);
wait(1);
turnLEDOff(greenThree);
wait(1);
turnLEDOn(greenThree);
wait(5);
turnLEDOff(greenThree);
ok=ok-1;
going=going
0;
}
}
}
going=going+1;
}
if(going>100)
{
if(ok==0)
{
if(SensorValue(sonarTwo)==5)
{
startMotor(motorOne, 12);
if(SensorValue(sonar)==5)
{
stopMotor(motorOne);
turnLEDOn(greenOne);
wait(1);
turnLEDOff(greenOne);
wait(1);
turnLEDOn(greenOne);
wait(1);
turnLEDOff(greenOne);
wait(1);
turnLEDOn(greenOne);
wait(5);
turnLEDOff(greenOne);
going=going0;
}
}
if(SensorValue(sonarTwo)==2)
{
startMotor(motorOne, 12);
if(SensorValue(sonar)==5)
{
stopMotor(motorOne);
turnLEDOn(greenOne);
wait(1);
turnLEDOff(greenOne);
wait(1);
turnLEDOn(greenOne);
wait(1);
turnLEDOff(greenOne);
wait(1);
turnLEDOn(greenOne);
wait(5);
turnLEDOff(greenOne);
going=going
0;
}
}
}
}
}
}

Unfortunately I’m not familiar with that particular project. I do notice that you are sending small values to the motor

startMotor(motorOne, 12);

you should try increasing that value if the motor is not moving.

I would also suggest using the ROBOTC debugger where you are able to see the values of your sensors and what control value the motor has been sent, this should help you understand what the program is doing.