有错误; &quot“功能定义在此处不允许(64,3)&quot"

发布于 2025-02-11 20:03:06 字数 1529 浏览 0 评论 0原文

支架位于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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文