【问题标题】:Getting an syntax error by using RasPiArduino for Raspberry Pi使用 RasPiArduino for Raspberry Pi 时出现语法错误
【发布时间】:2018-03-10 14:23:55
【问题描述】:

我正在使用带有 L298n 电机驱动器的 Raspberry Pi Zero 来控制两个电机。我正在使用 Python 脚本测试电机。效果很好。

现在我想使用 Arduino 软件对电机进行编程。我正在关注如何存档的本教程:https://www.youtube.com/watch?v=lZvhtfUlY8Y

然后我将其编码到 Arduino 软件 (v. 1.8.5)

void setup() {
  // put your setup code here, to run once:
  Console.println("Setup Einstellungen");
  pinMode(17, OUTPUT);
  delay(500);
  Console.println("Setup Einstellungen Ende");
}

void loop() {
  Console.println("Rechts Vorwärts");
  digitalWrite(17, HIGH);
  delay(1000);
  digitalWrite(17, LOW);
  delay(5000);
}

我使用“导出编译后的二进制文件”编译了文件。我使用 FileZilla 将它上传到 Raspberry 上,并尝试通过 SSH 运行它。

当我尝试运行它时:

(sudo) sketch_feb28.ino.bplus.bin

我收到以下错误:

:-bash:意外标记 `sketch_feb28.ino.bplus.bin' 附近的语法错误

运行file sketch_feb28.ino.bplus.bin

sketch_feb28a.ino.bplus.bin: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SY            SV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2            .0, BuildID[sha1]=a0260345a3700dca64c63fde8a10959214ce9b85, not stripped

我无法单独解决这个问题。

【问题讨论】:

  • 你能添加file sketch_feb28.ino.bplus.bin的结果吗?错误消息看起来像您在此处没有有效的二进制文件
  • 你想让我把文件上传到某个地方吗?
  • 不,只需运行命令和add the output to the questionfile 命令告诉你你有什么类型的文件
  • 既然你提到了Putty,你需要在你的树莓派上运行命令,而不是在Windows PC上
  • 我已将命令的输出添加到问题中。

标签: arduino raspberry-pi


【解决方案1】:

我仍然不确定,语法错误来自哪里。

运行文件:

./sketch_feb28.ino.bplus.bin

这是运行二进制文件的语法,它不在 PATH 中。由于该文件是有效的可执行文件,因此错误消息应该会消失。

【讨论】:

  • 非常感谢。使用sudo ./sketch_feb28a.ino.bplus.bin 运行文件已解决问题。
猜你喜欢
  • 2021-02-12
  • 2019-12-08
  • 1970-01-01
  • 1970-01-01
  • 2017-07-10
  • 2022-07-26
  • 1970-01-01
  • 2013-09-27
  • 2018-09-24
相关资源
最近更新 更多