1
votes

I'm trying to write a simple / my first hello world program for the arduino using ther IDE.

I have the following code block:

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  Serial.println("Hello, world!");
  delay(1000);
}

When i compile, I get the following error message:

/home/jj/Documents/arduino-1.0.5/hardware/tools/avr/bin/avr-g++: line 3: /home/jj/Documents/arduino-1.0.5/hardware/tools/avr/bin/../bin.gcc/avr-g++: cannot execute binary file
/home/jj/Documents/arduino-1.0.5/hardware/tools/avr/bin/avr-g++: line 3: /home/jj/Documents/arduino-1.0.5/hardware/tools/avr/bin/../bin.gcc/avr-g++: Success
/home/jj/Documents/arduino-1.0.5/hardware/tools/avr/bin/avr-g++ returned 126

I'm not sure how to resolve this. Any suggestions?

EDIT 1

How I've connected the Arduino:

I've connected it via USB. I can see it via the menu option in the IDE... and it's checked off properly. I've also ensured that I've selected the correct board type - UNO. the board itself has power. The ON led is green. And when i upload the code, the TX led flashes.

EDIT 2

Following the advice found here: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=37&t=18183

I renamed the folder and it compiles. But it doesn't let me upload the code to the board. I get the error:

Binary sketch size: 1,672 bytes (of a 32,256 byte maximum)
/home/jj/Documents/arduino-1.0.5/hardware/tools/avrdude: 1: /home/jj/Documents/arduino-1.0.5/hardware/tools/avrdude: ELF: not found
/home/jj/Documents/arduino-1.0.5/hardware/tools/avrdude: 2: /home/jj/Documents/arduino-1.0.5/hardware/tools/avrdude: Syntax error: "(" unexpected
1
how did you compile it?taocp
using the arduino IDE's compile button! It's their "Verify" button...dot
is that all? I mean the entire program? Seems C# rather than C++ from just this snippet without any header..Marco A.
that's it. that's the entire program.dot
Try giving this a go. I doubt it's permissions related, you'd probably get an error earlier in that case. http://www.raspberrypi.org/phpBB3/viewtopic.php?f=37&t=18183Nathan

1 Answers

1
votes

I completely uninstalled the Arduino IDE and all dependencies. Then i used the software center in ubuntu to find and install the IDE. and now its working.