Daniel M
Daniel M

Reputation: 766

Getting an syntax error by using RasPiArduino for Raspberry Pi

I am using an Raspberry Pi Zero with an L298n motor driver to control two motors. I was testing the motors using a Python script. That worked fine.

Now I wanted to use the Arduino software to program the motors. I was following this tutorial on how to archive that: https://www.youtube.com/watch?v=lZvhtfUlY8Y

Then I coded this into the Arduino software (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);
}

I compiled the file using "Export compiled Binary". I uploaded it on the Raspberry using FileZilla and tried to run it via SSH.

When I tried to run it with:

(sudo) sketch_feb28.ino.bplus.bin

I got the following error:

: -bash: syntax error near unexpected token `sketch_feb28.ino.bplus.bin'

Running 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

I cannot solve this issue alone.

Upvotes: 2

Views: 96

Answers (1)

rollstuhlfahrer
rollstuhlfahrer

Reputation: 4078

I'm still not sure, where the syntax error comes from.

Run the file with:

./sketch_feb28.ino.bplus.bin

This is the syntax for running a binary, that is not in PATH. Since the file is a valid executable, the error message should vanish.

Upvotes: 1

Related Questions