#pragma config(Sensor, S1,		 touchSensor,		 sensorEV3_Touch)
#pragma config(Sensor, S2,		 gyroSensor,		 sensorEV3_Gyro)
#pragma config(Sensor, S3,		 colorSensor,		 sensorEV3_Color, modeEV3Color_Ambient)
#pragma config(Sensor, S4,		 sonarSensor,		 sensorEV3_Ultrasonic)
#pragma config(Motor,	 motorB,					rightMotor,		 tmotorEV3_Large, PIDControl, driveRight, encoder)
#pragma config(Motor,	 motorC,					leftMotor,		 tmotorEV3_Large, PIDControl, driveLeft, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

/*
Create a program that turns on the lights automatically using the Color Sensor
when the ambient light level drops below a certain level.
*/

task main()
{
	//Wait for the level of ambient light intensity to drop below 15.
	while(getColorAmbient(colorSensor) >= 15)
	{
		//Do nothing while we're waiting.
		sleep(1);
	}

	//Display Image "Light on" on the LCD Screen.

	drawBmpfile(0, 127, "Light on");

	//Stay on for 5 seconds.
	sleep(5000);
}
