Go Down

Topic: [SOLVED] Problem with Arduino 1.0 IDE (Linux) and Blinking (Read 1 time) previous topic - next topic

Vito

Jan 04, 2012, 02:47 pm Last Edit: Jan 06, 2012, 02:41 pm by Vito Reason: 1
I'm using an Arduino UNO board and I've a problem with the Arduino 1.0 IDW (I'm using Slackware Linux).
In particular the Blinking of a Led doesn't work.
The code that I used is here:

Code: [Select]

// Example 01 : Blikning LED


#define LED 13 // LED connected to
             // digital pin 13
             
             
void setup() {  
 pinMode(LED,OUTPUT); //sets the digital pin
                      //as output                
}

void loop(){
 digitalWrite(LED,HIGH); //turns LED on
 delay(3000);            // wait 3 seconds
 digitalWrite(LED,LOW);  //turns the LED off
 delay(3000);
}


It worked on Arduino 0021.
Me(Slackware64) and another Arduino Linux user (Slackware) have the same problem.
We're using the Slacky.eu packages (I'm the mantainer of these packages).
I tried to use Slackbuilds.org packages but the problem remains the same.
With the 0022 version the problem can be solved with an:

Code: [Select]
#include "ArduinoTestSuite.h

but in the current version I didn't find this library.

Thanks of all!
Stat rosa pristina nomine,nomina nuda tenemus.
[Umberto Eco - Il nome della Rosa]

madworm

So you're saying "It doesn't work" - whatever that actually means. That is not helpful.

The code you've posted compiles fine.
• Upload doesn't work? Do a loop-back test.
• There's absolutely NO excuse for not having an ISP!
• Your AVR needs a brain surgery? Use the online FUSE calculator.
My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...
• Microsoft is not the answer. It is the question, and the answer is NO!

Vito

Sorry, I forgot to explain what I mean with "doesn't work".
The code (as you can see) is correct,but the led doesn't blink!
It remains always HIGH.
Stat rosa pristina nomine,nomina nuda tenemus.
[Umberto Eco - Il nome della Rosa]

madworm

#3
Jan 04, 2012, 04:45 pm Last Edit: Jan 04, 2012, 04:47 pm by madworm Reason: 1
So it hangs inside delay(3000);

The only reason for that would be that 'millis()' doesn't change, and that means that timer0 doesn't run.

Could you test:

Code: [Select]
void setup() {
 Serial.begin(9600);
}

void loop() {
 Serial.println(millis());
}


Also I should point out that some versions of avr-gcc seem unusable. I think 4.3.3 and 4.4.3 are good. Personally I have a self-compiled version using the build-script for linux, which can be found on avrfreaks.net
• Upload doesn't work? Do a loop-back test.
• There's absolutely NO excuse for not having an ISP!
• Your AVR needs a brain surgery? Use the online FUSE calculator.
My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...
• Microsoft is not the answer. It is the question, and the answer is NO!

Vito

#4
Jan 04, 2012, 05:49 pm Last Edit: Jan 04, 2012, 05:51 pm by Vito Reason: 1
The code works fine!
I can read the output in the serial monitor.
So,Could it be my version of GCC? (4.5.3)
I will try to downgrade it.
Stat rosa pristina nomine,nomina nuda tenemus.
[Umberto Eco - Il nome della Rosa]

Vito

same problem with 4.4.3 .
Now I try with 4.3.3 .
Stat rosa pristina nomine,nomina nuda tenemus.
[Umberto Eco - Il nome della Rosa]

stimmer

This sounds like the binutils bug, if so you need to downgrade binutils (which might imply downgrading gcc too). Search the forum, lots of other people have had this problem and there are other ways round it (I think simply including the serial library cures it).

Vito

Same problem with 4.3.3 .
I try to downgrade also binutils.
Stat rosa pristina nomine,nomina nuda tenemus.
[Umberto Eco - Il nome della Rosa]

Vito

With gcc 4.3.3 and binutils 2.20.1 the blinking works fine!
Stat rosa pristina nomine,nomina nuda tenemus.
[Umberto Eco - Il nome della Rosa]

Go Up