Bumperswitch not working

So my code for a bumperswitch on robotc is not working I have tried using competition template, but I do not want to use that because I have no user control period. My code does absolutely nothing whether I am using the competition template or not. What am I doing wrong?

#pragma config(Sensor, dgtl12, bumperswitch,   sensorTouch)
#pragma config(Motor,  port1,           armmotor,      tmotorVex393_HBridge, openLoop)
#pragma config(Motor,  port2,           jawmotor,      tmotorVex393_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
	if(SensorValue[dgtl12] == 0){

		motor[port1] = 40; // motor is set to run at a power of 40
		motor[port10] = 20; // motor is set to run at a power of 20
	}
		else
		{
			motor[port1] = 0;
			motor[port10] = 0;
		}
}

The conditional runs once on start of the program. Put the if else statement in a while(true) loop so that it detects the bumper switch continually instead of once at the start of the program.

you need put you code inside

while (1==1)  {
}

to keep code from exiting
and you need wait or sleep to prevent exhaust the CPU