A little help with my code, please

So basically we are supposed to build a conveyor belt with 3 automatic stops with 2 different types of sensors. It also has to be started by a bumpswitch and there must be an emergency stop button to stop the operations.

The sensors that we are going to use are two line followers and a light sensor, supposedly controlled by a flashlight.

Current issues:

  1. lines with pause() has a error that reads “Unexpected ‘)’ during phrasing”, which I have no idea what it’s about.

  2. I don’t know how to implement the flashlight with the line sensor in order to make it stop at the appropriate time.

Note: the threshold values for all analog sensors are denoted by three asterisks “*” because we have not calculated the threshold values yet.

#pragma config(Sensor, in1,    LightSensor,    sensorReflection)
#pragma config(Sensor, in2,    LineF1,         sensorLineFollower)
#pragma config(Sensor, in3,    LineF2,         sensorLineFollower)
#pragma config(Sensor, dgtl1,  BumpStart,      sensorTouch)
#pragma config(Sensor, dgtl2,  BumpStop,       sensorTouch)
#pragma config(Motor,  port2,           Motor1,        tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port10,          FlashLight,    tmotorVexFlashlight, openLoop, reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

void run()
{startMotor(Motor1,20);
}

void pause_1()
{stopMotor(Motor1);
	wait(10);
	startMotor(Motor1, 20);
	wait(2);
}

task e_stop()
{
	while(true)
	{
		if(SensorValue(BumpStop) == 1)
		{
			stopAllTasks(); // this ends the program
		}
		wait1Msec(10);  // this prevents the current task from hogging the CPU
	}
}

task main()
{ startTask(e_stop);
	untilBump(BumpStart);
	{
		while(1==1)
		{	run();
			if(SensorValue(LineF2)>= ***)
			{pause_1();

				turnFlashlightOn(FlashLight, -120);
				wait(10);
				turnFlashlightOff(FlashLight);
			}
			if(SensorValue(LineF1)>= ***)
			{pause_1();
			}
			if(SensorValue(LightSensor) >= ***)
			{pause_1();
			}

Hopefully you have made some progress with this. Here is a version of you code that at least compiles (you need to enable Natural language for PLTW).

#pragma config(Sensor, in1,    LightSensor,    sensorReflection)
#pragma config(Sensor, in2,    LineF1,         sensorLineFollower)
#pragma config(Sensor, in3,    LineF2,         sensorLineFollower)
#pragma config(Sensor, dgtl1,  BumpStart,      sensorTouch)
#pragma config(Sensor, dgtl2,  BumpStop,       sensorTouch)
#pragma config(Motor,  port2,           Motor1,        tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port10,          FlashLight,    tmotorVexFlashlight, openLoop, reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

void run()
{
  startMotor(Motor1,20);
}

void pause_1()
{
  stopMotor(Motor1);
  wait(10);
  startMotor(Motor1, 20);
  wait(2);
}

task e_stop()
{
  while(true)
  {
    if(SensorValue(BumpStop) == 1)
    {
      stopAllTasks(); // this ends the program
    }
    wait1Msec(10);  // this prevents the current task from hogging the CPU
  }
}

task main()
{ 
  startTask(e_stop);
  
  untilBump(BumpStart);
  
    while(1==1)
    { 
      run();
      
      if(SensorValue(LineF2)>= 100)
        {
        pause_1();

        turnFlashlightOn(FlashLight, -120);
        wait(10);
        turnFlashlightOff(FlashLight);
        }
        
      if(SensorValue(LineF1)>= 100)
        {
        pause_1();
        }
        
      if(SensorValue(LightSensor) >= 100)
        {
        pause_1();
        }
    }
}