Do you use Arcade Mode in RobotC? Can you increase the speed of the motors in Arcade Mode? We are currently using Arcade Mode, but leaving the parameters blank. We are troubleshooting but I wanted to check here.
Then you move the joystick all the way forward, it should be setting the motors to 100%
Not really. The built-in arcade command is kind of limited to half-speed, since the limiting is not done well. Let’s check the source (adapted from $ROBOTC/Include/NatLang_IQ.c):
void arcadeControl(TVexJoysticks verticalJoystick = ChA, TVexJoysticks horizontalJoystick = ChB, short threshold = 10) {
...]
nRightSideSpeed = ((getJoystickValue(verticalJoystick) - getJoystickValue(horizontalJoystick))/2);
nLeftSideSpeed = ((getJoystickValue(verticalJoystick) + getJoystickValue(horizontalJoystick))/2);
if(nGlobalJoyScaledValue != nMaxJoyScaleValue) {
nRightSideSpeed = nRightSideSpeed * (nGlobalJoyScaledValue / 100.0);
nLeftSideSpeed = nLeftSideSpeed * (nGlobalJoyScaledValue / 100.0);
}
...]
}
Now, there’s a setJoystickScale(short) function, but that won’t let you set more than nMaxJoyScaleValue (100), so no workie.
What you can actually do is to directly modify the nGlobalJoyScaledValue, set it to 200, but expect the turns to behave little differently under full throttle.
Thanks, it for sure isn’t going at 100% speed. Steve, maybe I can show you at tomorrow’s competition?
nenik is correct, it’s totally not setting the motors to 100%. I would call that a bug. If you want to create your own function, it would be just like the normal RobotC function
void CustomArcadeControl(TVexJoysticks verticalJoystick = ChA, TVexJoysticks horizontalJoystick = ChB, short threshold = 10)
{
short nRightSideSpeed;
short nLeftSideSpeed;
updateMotorDriveTrain();
if(abs(vexRT[verticalJoystick]) <= abs(threshold) && abs(vexRT[horizontalJoystick]) <= abs(threshold))
{
nRightSideSpeed = 0;
nLeftSideSpeed = 0;
}
else
{
nRightSideSpeed = getJoystickValue(verticalJoystick) - getJoystickValue(horizontalJoystick)/2;
nLeftSideSpeed = getJoystickValue(verticalJoystick) + getJoystickValue(horizontalJoystick)/2;
if(nGlobalJoyScaledValue != nMaxJoyScaleValue)
{
nRightSideSpeed = nRightSideSpeed * (nGlobalJoyScaledValue / 100.0);
nLeftSideSpeed = nLeftSideSpeed * (nGlobalJoyScaledValue / 100.0);
}
}
setMotorSpeeds(nRightSideSpeed, nLeftSideSpeed);
}
The only change is that the code above does NOT divide the vertical joystick by 2.
To help explain this, I would suggest having the team calculate nRightSideSpeed & nLeftSideSpeed for both functions.
Everything above is on the “advanced” side, so it may be tough to explain in a way the team can understand.
We won’t be there this weekend. In fact, I’m not sure you’ll have any challengers at all!
Good luck.
Steve
Thanks Steve - we aborted programming of the remote and just went default for that weekend’s competition. Our middle school team did win Teamwork and take Excellence with our elementary team coming in the second place pairing. I will see you next weekend. Bringing all four teams to state this year. Back to the drawing board to get the remote the way they want though.