//Some Variables Used
//as_per_point -> dutycycle required (required speed)
//el,lt,cl, extreme left, left,central left sensors
//and similar for er,rt,cr
void linetrack()
{
temp=output& 0x0F;
if(temp==0x00)
return;
else if(temp==0x0F)
return;
else{
if(!(el|lt|cl|cr|rt|er)){}
else{
elx=el;ltx=lt;clx=cl;crx=cr;rtx=rt;erx=er;
}
output=RIGHT_F_LEFT_F;
value=(10*elx+20*ltx+30*clx+40*crx+50*rtx+60*erx);
deviation=(value/(elx+ltx+clx+crx+rtx+erx)-35)/5;
correction_l=as_per_point+deviation*as_per_point/5;
correction_r=as_per_point-deviation*as_per_point/5;
if(correction_l>=255) lval=255;
else if(correction_l<=0)lval=0;
else lval=correction_l;
if(correction_r>=255) rval=255;
else if(correction_r<=0) rval=0;
else rval=correction_r;
}
}