// start time 3:05
// light sensor
// touch sensor
// rcx perecious fred
void main(){
int black;
int white;
int avg;
alloff();
while(prgm_button() == 0)
{
printf("put on white and press start\n");
beep();
sleep(0.5);
}
white = light(1);
while(prgm_button() ==0)
{
beep();
sleep(0.5);
}
black = light(1);
avg = (black + white)/2;
while(prgm_button() == 0)
{
printf("%d\n",avg);
beep();
sleep(0.5);
}
// go till hits first line
while(light(1) > avg)
{
motor(A,100);
motor(B,100);
}
// hits the first line, go till second line
while(light(1) > avg)
{
motor(A,100);
motor(B,100);
}
//stops when hits second line
alloff();
}