#pragma config(Sensor, S1,     svetelny,       sensorLightActive)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
	int uroven_svetla = 0;

	while(true)
	{
		uroven_svetla = SensorValue(svetelny);

		if (uroven_svetla < 45)
		{
			eraseDisplay();
			nxtDisplayCenteredTextLine(0, "Svetlo");
			nxtDisplayRICFile(25, 5, "faceOpen.ric");
			wait1Msec(50);
	  }

	  if (uroven_svetla > 60)
		{
			eraseDisplay();
			nxtDisplayCenteredTextLine(0, "Tma");
			nxtDisplayRICFile(25, 5, "faceclosed.ric");
	  }
  }
}
