ZBLOG

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

根据你提供的错误信息,出现了两个问题。让我们逐一分析。

1. 函数调用参数不足

错误信息:

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() 时传入所有必需的参数。例如,如果你的参数是 Left1_Speed, Left2_Speed, Right1_Speed, 等等,请这样调用:

Motor(Left1_SpeedValue, Left2_SpeedValue, Right1_SpeedValue, Right2_SpeedValue,
      qa_value, qb_value, qc_value, qd_value,
      qe_value, qf_value, qg_value, qh_value);

请替换上面代码中的变量为你实际使用的值。

2. digitalWrite() 使用不当

错误信息:

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

这个错误是因为你在调用 digitalWrite() 函数时漏掉了第二个参数。digitalWrite() 函数需要两个参数:第一个是引脚号,第二个是要写入的值(HIGHLOW)。

解决方法:

修正这行代码,将其改为正确的格式。例如:

digitalWrite(cu1, HIGH); // 或者 LOW,根据需求选择

总结

  • 确保每次调用函数都提供必要的参数。
  • 检查每个函数调用以确保其语法正确,并且所有必需的信息都已包含。

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


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

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

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

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

联系我们

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

微信号:3007537140

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

关注我们
x

注册

已经有帐号?