Quote:
Originally Posted by whitetiger0990
Which line does it say that error is on?
|
The printf line (unsure specific number, but that line).
I don't have the entire error anymore, but it said the error was "type qualifier mismatch in assignment" on the printf line in teleop.c.
Quote:
In your tank function, you don't set any PWM values, therefore the PWMs will still be what they were before the function was called. When you first turn the robot on, it won't move. Once the PWMs get set in the mecanum function, they will continue with the same value once you start calling the tank function again.
In the mecanum function, the calculations can very easily overflow a char. You'll need to protect against that. I don't know if that is the only problem, but it will definitely cause you problems.
|
I'm really not terribly worried about the tank function, but thanks for pointing that out. We will try this if we can't get mechanum to work.
That being said, this is almost the exact same mechanum code we used at the competition. It should work, but it isn't.
How would we stop it from overflowing the chars?
Quote:
Your print statements have mixed types where you attempt to print unsigned char (e.g., pwm01) and double (wFL) types as ints (%d). Typecast the arguments (int).
Statements such as:
pwm01 = (int)wFL + 127;
start with a double, typecast it to int, then assign it to unsigned char
as opposed to keeping your calculation as double then typecasting the result to unsigned char.
Are you doing that to speed things up? Just curious, not a problem.
|
On our last bot, we had some issues with the robot spitting out relatively random PWM values (usually like -16573 or something). We fixed those (from what I remember) by adding the int typecasts. This may be the same issue, but I can't find out because the printfs aren't working.