有错误; &quot“功能定义在此处不允许(64,3)&quot"
支架位于int main()之后。这是针对vex机器人技术的。我正在使用VexCode V5来编程机器人。这是C ++。该代码是允许机器人向前和向后行驶,并使用所需的特定类型的轮子进行侧面方式。如果我没记错的话,那些轮子的名称是mecanum车轮。
{
Motor1.spin(forward);
Motor2.spin(forward);
Motor3.spin(forward);
Motor4.spin(forward);
int main ()
{
while(true)
{
// REMEMBER:
// m1(x, y) = y + x
// m2(x, y) = y - x
// m3(x, y) = y + x
// m4(x, y) = y - x
// motor[Front_Left] = 1
// motor[Front_Right] = 2
// motor[Back_Right] = 3
// motor[Back_Left] = 4
// vexRT[Ch1] = Left/Right
// vexRT[Ch2] = Up/Down
// vexRT[Btn5U] = Counter-Clockwise
// vexRT[Btn6U] Clockwise
motor[Front_Left] = vexRT[Ch2] + vexRT[Ch1];
motor[Front_Right] = vexRT[Ch2] - vexRT[Ch1];
motor[Back_Right] = vexRT[Ch2] + vexRT[Ch1];
motor[Back_Left] = vexRT[Ch2] - vexRT[Ch1];
if (vexRT[Btn5U] == 1) {
// rotate counter clockwise
motor[Front_Left] = -127;
motor[Front_Right] = 127;
motor[Back_Right] = 127;
motor[Back_Left] = -127;
wait1Msec(50);
motor[Front_Left] = motor[Front_Right] = motor[Back_Right] = motor[Back_Left] = 0;
}
if (vexRT[Btn6U] == 1) {
//rotate clockwise
motor[Front_Left] = 127;
motor[Front_Right] = -127;
motor[Back_Right] = -127;
motor[Back_Left] = 127;
wait1Msec(50);
motor[Front_Left] = motor[Front_Right] = motor[Back_Right] = motor[Back_Left] = 0;
}
} //END OF WHILE LOOP
} //END OF TASK MAIN
}
The bracket is located after int main (). This is for VEX robotics. I'm using VexCode V5 to program the Robot. This is C++. This code is to allow the robot to drive forward and backward, and also side ways using the specific kind of wheels needed. If I'm not mistaken that names of those wheels are mecanum wheels.
{
Motor1.spin(forward);
Motor2.spin(forward);
Motor3.spin(forward);
Motor4.spin(forward);
int main ()
{
while(true)
{
// REMEMBER:
// m1(x, y) = y + x
// m2(x, y) = y - x
// m3(x, y) = y + x
// m4(x, y) = y - x
// motor[Front_Left] = 1
// motor[Front_Right] = 2
// motor[Back_Right] = 3
// motor[Back_Left] = 4
// vexRT[Ch1] = Left/Right
// vexRT[Ch2] = Up/Down
// vexRT[Btn5U] = Counter-Clockwise
// vexRT[Btn6U] Clockwise
motor[Front_Left] = vexRT[Ch2] + vexRT[Ch1];
motor[Front_Right] = vexRT[Ch2] - vexRT[Ch1];
motor[Back_Right] = vexRT[Ch2] + vexRT[Ch1];
motor[Back_Left] = vexRT[Ch2] - vexRT[Ch1];
if (vexRT[Btn5U] == 1) {
// rotate counter clockwise
motor[Front_Left] = -127;
motor[Front_Right] = 127;
motor[Back_Right] = 127;
motor[Back_Left] = -127;
wait1Msec(50);
motor[Front_Left] = motor[Front_Right] = motor[Back_Right] = motor[Back_Left] = 0;
}
if (vexRT[Btn6U] == 1) {
//rotate clockwise
motor[Front_Left] = 127;
motor[Front_Right] = -127;
motor[Back_Right] = -127;
motor[Back_Left] = 127;
wait1Msec(50);
motor[Front_Left] = motor[Front_Right] = motor[Back_Right] = motor[Back_Left] = 0;
}
} //END OF WHILE LOOP
} //END OF TASK MAIN
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论