Function Delay

Hello i'm italian so i don't speak very good your language.

My problem is :
Function delay not works with Archlinux.

Can you suggest a method to solve?

Thanks a lot

Can you please tell us what exactly fails? Do you get a compilation error? Does 'delay' give you no delay at all? Too short a delay? Too long a delay? Or does it crash the Arduino?

Delay non works literally!

The delay there is not!
For example the blink example non works ,
led doesn't blinks!

There is a problem with the complier on some Linux distributions.

This is in English, but has a history of the issue: http://arduino.cc/forum/index.php/topic,49900.15.html

See this thread about changing binutils: Incrementation bug? WTF? [BROKEN COMPILER - SOLVED] - #21 by system - Programming Questions - Arduino Forum

One poster suggested that initializing a Global variable would sometimes solve the problem (e.g. "char dummyvariable = 123;").

I have read that topics but i have not understood like solve!
There is not a method that you can suggest to me?
I use Archlinux and i tried many things but the problem hang!

You can try to run WINE windows emulator and run the compiler IDE from there.... It is not the greatest solution but it might just work.


Si può cercare di eseguire WINE emulatore di Windows ed eseguire il compilatore IDE da lì .... Non è la soluzione ottimale ma potrebbe funzionare.

Rob

(translations by google translate :wink:

edge:
I have read that topics but i have not understood like solve!
There is not a method that you can suggest to me?
I use Archlinux and i tried many things but the problem hang!

Try this code from the earlier referenced thread (Arduino Mega 1280 delay() turbocharged - #23 by stimmer - IDE 1.x - Arduino Forum):

char dummyvariablecuzmaintainerborkedthecompiler = 123; // force something into the .data segment with non-zero initializer
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */

void setup() {  
  dummyvariablecuzmaintainerborkedthecompiler++;  // stops the linker from removing the global variable
  
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(13, OUTPUT);     
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  delay(1000);              // wait for a second
}

@Rob thanks for the answer but i prefer not to install wine!

@Cr0sh
Thanks for the answer,Now i can't try code,but that is not a general solution i think!

I just found this topic. and it seems to be similar to the problem I just posted...

http://arduino.cc/forum/index.php/topic,68512.0.html