Thank you for the reply, I really appreciate it
the first mistake you pointed out is a posting mistake (sory),
" [void Werteberechnung() " just exists as " void Werteberechnung() " so it is not the big problem.
I also tried to avoid a devision by zero. I will give you some more code to give you some more information about it and how I tried it.
What i am trying to program is kind of a motorbike with 2 front wheels, like a car. When a car drives a kurve, the inner wheel has to have asteeper angle than the outer wheel. The angles should be calculated by the funktion, which I have problems with at the moment.
motorB is used as a remote control. I'd like to give the angle via motorB. The motors A and C should take the calculated angle they need to let the entire car drive a nice circle.
if ((nMotorEncoder[motorB]/3 > -82) && (-1 < nMotorEncoder[motorB]/3))
{
Werteberechnung_links();
Werteberechnung_rechts();
}
else
{
if ((1 < nMotorEncoder[motorB]/3) &&
(82 > nMotorEncoder[motorB]/3))
{
Werteberechnung_links();
Werteberechnung_rechts();
}
the code above is "supposed" to avoid a devision by 0 and also than the wheels can turn more than 180°.
the funktions
Werteberechnung_links() and
Werteberechnung_rechts() should calculate the values for the motors A and C
float Werteberechnung_links()
{
if ( nMotorEncoder[motorB] != 0)
{
uual = (PI/180) * nMotorEncoder[motorB];
ual = (23 * cot(uual)) - 3.05;
al = (180/PI) * atan(ual);
return al;
}
}
float Werteberechnung_rechts()
{
if ( nMotorEncoder[motorB] != 0)
{
uuar = (PI/180) * nMotorEncoder[motorB];
uar = (23 * cot(uuar)) + 3.05;
ar = (180/PI) * atan(uar);
return ar;
}
}
the remaining code works perfectly, including the one which let the motors turn at the end.
My problem now is that the message "Unreferenced procedure 'Werteberechnung_links' " still remains. It is the same with the other posted funktion " Werteberechnung_rechts() " and that the program itsself doesn't know " cot() " ( could it be that I have an older version of RobotC? ).
Already lots of thanks for any replies that come.
[/code]