Community
cancel
Showing results for 
Search instead for 
Did you mean: 
RHarc
Novice
1,136 Views

Don't sure about error. How to fix?

Jump to solution

I pasted the error report that I received. I'm a student trying to learn this, but I can't find a solution. Please help!

I'm also pasting the code that I'm trying to upload to my Arduino. The code is from Sunfounder's website. The site was:

http://www.sunfounder.com/learn/RFID_kit_V1_for_Arduino/lesson-3-interactive-led-flowing-led-lights-...

Error Message:

Arduino: 1.8.1 (Windows Store 1.8.1.0) (Windows 10), Board: "Arduino/Genuino Uno"

collect2.exe: error: ld returned 5 exit status

exit status 1

Error compiling for board Arduino/Genuino Uno.

This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.

Code that I wrote (copied):

int ledNum = 8; //the number of the led you attach

byte ledPin[] = {2,3,4,5,6,7,8,9}; //Create array for LED pins

int ledDelay; //delay between changes

int direction = 1;

int currentLED = 0;

unsigned long changeTime;

int potPin = 0; //select the input pin for the potentiometer

void setup()

{

for (int x = 0; x < ledNum; x++) // set all pins to output

{

pinMode (ledPin[x], OUTPUT);

}

changeTime = millis();//

}

void loop() {

ledDelay = analogRead(potPin); //read the value from the pot

if ((millis() - changeTime) > ledDelay)

{ // if it has been ledDelay ms since last change

changeLED();

changeTime = millis();

}

}

void changeLED()

{

for (int x=0; x < ledNum; x++)

{ // yurn off all LED's

digitalWrite(ledPin[x], LOW);

}

digitalWrite(ledPin[currentLED], HIGH); // turn on the current LED

currentLED += direction; // increment by the direction value

// change direction if we reach the end

if (currentLED == ledNum-1)

{

direction = -1;

}

if (currentLED == 0)

{

direction = 1;

}

}

0 Kudos
1 Solution
RHarc
Novice
121 Views

solved the problem. I switched to a different USB port. Not sure why the first USB port din't work but that is a problem for a another day.

Thank you for the help.

View solution in original post

5 Replies
FTinetti
Honored Contributor I
121 Views

Hi DarkHark,

When do you have that error (compile or load time?)

Is your Intel Galileo properly recognized once turned on and plugged in?

Beyond those questions, I think you are trying to use analogRead on pin 0, which does not have an AD converter and is set to OUPUT ...

Fernando.

RHarc
Novice
121 Views

I think it's on compiling. I should have included the fact that it states: Error compiling for board Arduino/Genuino Uno.

That message is in orange just over the error message I wrote first.

As for the second question, I have done other projects successfully. so the Arduino and the computer recognize each other.

Hope that helps you help me.

FTinetti
Honored Contributor I
121 Views

DarkHark wrote:

I think it's on compiling. I should have included the fact that it states: Error compiling for board Arduino/Genuino Uno.

That message is in orange just over the error message I wrote first.

As for the second question, I have done other projects successfully. so the Arduino and the computer recognize each other.

Hope that helps you help me.

Try the option "Verify" instead of "Upload".

Please recall to select the proper Intel Galileo card in Tools ==> Board menu so that you compile for the Intel Galileo you have, and remember.

Your computer has to recognize your Intel Galileo regardless whetther you had used Arduino or not.

HTH,

Fernando.

RHarc
Novice
122 Views

solved the problem. I switched to a different USB port. Not sure why the first USB port din't work but that is a problem for a another day.

Thank you for the help.

View solution in original post

FTinetti
Honored Contributor I
121 Views

DarkHark wrote:

solved the problem. I switched to a different USB port. Not sure why the first USB port din't work but that is a problem for a another day.

Thank you for the help.

good to know,

Fernando.

Reply