Programming w/ IDE

Hi.

I am a beginner with the Arduino Uno. I uploaded my code:

[code[code]
void setup() {
  // pinMode(3,OUTPUT);
  }

void loop() {
  // digitalWrite(3, HIGH);
  // delay(1000);
  // digitalWrite(3, LOW);
  // delay(1000)

}

][/code][/code]

When it finished uploading, I assumed it would start running. It did not. I have tried uploading it again and it still does not work.

Please help.

You have no code. It is all commented out.

You need to learn to use the code tags so that we don't see remnants of them.

// tells the compiler to ignore everything on the line to the right of the //.

I'm sorry,

Is this better?

void setup() {
  // pinMode(3,OUTPUT);//
  }

void loop() {
  // digitalWrite(3, HIGH);//
  // delay(1000);//
  // digitalWrite(3, LOW);//
  // delay(1000)//

}

You still have every single line of code in that program commented out. Your code effectively reduces to:

void setup(){}
void loop(){}

Did I not say that I was a beginner? If you would actually help me out instead of just criticizing me on my FIRST PROGRAM EVER, we could actually get somewhere.

P.S. I'm 13, not an adult like the rest of you,

gbarker: Did I not say that I was a beginner? If you would actually help me out instead of just criticizing me on my FIRST PROGRAM EVER, we could actually get somewhere.

P.S. I'm 13, not an adult like the rest of you,

I'm not criticizing you. I'm telling you what is wrong with your program. You have every single line commented out so there is no program there. Is that not what you want to know?

Well, how do I fix it?

P.S. I was talking to everyone else.

Thank you.

Maybe you don't know what commented out means? See reply #2. When you put the "//" in front of a line of code it tells the compiler to ignore it. It is the same as deleting that line as far as the program is concerned. Since you have that on every line, the compiler is ignoring the entire program.

So, quite obviously, the fix is to remove all those double slashes.

You should make use of the language reference page as you are learning https://www.arduino.cc/en/Reference/HomePage

The use of comments // are covered here https://www.arduino.cc/en/Reference/Comments

Thank you!!!

That was my first program and I could not figure that out. That was a big help. :D

Also, how do you stop a program? it just keeps running!!

Yes, everything in the setup function runs once and then the loop function repeats forever. To stop it remove the power. If you don't want some code to repeat forever then put it in the setup function instead of loop.

gbarker: Also, how do you stop a program? it just keeps running!!

for (;;){}  //stop right here

or

while (true){}  //stop right here

//stop right here until there is a reset! Maybe perhaps just wait until there is a button press to continue:

while (digitalRead(pinX) == 1){
// hang out until pinX is connected to Gnd with a button press
}
// button pressed, continue the program ...