ZBLOG

H:\Documents\Arduino\CAR007\CAR007\CAR007.ino: In function 'void loop()': H:\Documents\Arduino\CAR007\CAR007\CAR007.ino:62:9: error: too few arguments to function 'void Motor(int, int, int, int, int, int, int, int, int, int, int, int)' Motor();...

根据你提供的错误信息,主要有两个问题需要解决。

1. Motor 函数调用参数不足

错误提示:

error: too few arguments to function 'void Motor(int, int, int, int, int, int, int, int, int, int, int, int)'
   Motor();

这个错误说明你在调用 Motor() 函数时没有传入必要的参数。根据函数声明,Motor 需要12个整数类型的参数。

解决方法:

在调用 Motor 时,必须传入所需的12个参数。例如:

// 假设你已经定义了这些变量并赋值
int Left1_Speed = ...; // 设置具体值
int Left2_Speed = ...;
int Right1_Speed = ...;
int Right2_Speed = ...;
int qa = ...;
int qb = ...;
int qc = ...;
int qd = ...;
int qe = ...;
int qf = ...;
int qg = ...;
int qh = ...;

// 调用 Motor 函数,并传入所有参数
Motor(Left1_Speed, Left2_Speed, Right1_Speed, Right2_Speed,
      qa, qb, qc, qd,
      qe, qf, qg, qh);

确保将上述代码中的变量替换为你实际使用的值。

2. digitalWrite() 使用不当

错误提示:

error: expected primary-expression before ')' token
   digitalWrite(cu1,)

这个错误是由于在 digitalWrite() 函数调用中漏掉了第二个参数。该函数需要两个参数:引脚号和写入的值(如 HIGHLOW)。

解决方法:

修正这行代码,如下所示:

digitalWrite(cu1, HIGH); // 或者使用 LOW,根据你的需求选择合适的值。

总结

  • 确保每次调用 Motor 函数时都提供12个必要的整数类型参数。
  • 在使用 digitalWrite() 时确保包含引脚和状态(HIGH/LOW)的所有必要信息。

如果还有其他问题或更详细的信息需要帮助,请随时告诉我!


内容由零声教学AI助手提供,问题来源于学员提问

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=19261

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?