Author Options:

Arduino Answered

Can you help me I have a problem, this program :

  • Blink
  • The basic Arduino example. Turns on an LED on for one second,
  • then off for one second, and so on... We use pin 13 because,
  • depending on your Arduino board, it has either a built-in LED
  • or a built-in resistor so that you need only an LED.

int ledPin = 13; // LED connected to digital pin 13

void setup() // run once, when the sketch starts
pinMode(ledPin, OUTPUT); // sets the digital pin as output

void loop() // run over and over again
digitalWrite(ledPin, HIGH); // sets the LED on
delay(1000); // waits for a second
digitalWrite(ledPin, LOW); // sets the LED off
delay(1000); // waits for a second

it says that the input pin is 13, ok, but I don't see the output pin, WHERE IS THE OUT PUT PIN???
Lets say, I connect the positive(longer ) wire of the LED to pin 13(the input pin), and the negative (shorter) wire to what pin, what output pin???



checkout makeshed.com on the bottom of the Arduino page it has some cool tutorial videos it really helped me

Output pin is pin thirteen because it outputs the voltage


9 years ago

as you see in the picture all the pins are labled on the board, and pin 13 is the pin next to the GND pin labled as 1 on top and 3 on the bottom. And you do not need a resistor for pin 13 as it already has a built in resitor, therefore for connecting the led, connect the positive end to pin 13 and the negative to GND and it should light up. Pin 13 is also connected with an led on the board so the led on the board should light up simulteneously. Hope it helped. -Alvin


9 years ago

On the "official," fully-compliant Arduino boards, an on-board LED is permanently connected to output #13.....which explains output #13's use in the demo.

Here's the Diecimila schematic--the LED is wired to output 13 through a 1K resistor.

If your board doesn't have a built-in LED, connect one externally exactly like the above schematic.... (#13 -> 1K -> LED -> GND.)

Reread the source code--there isn't an input. It blinks pin #13. You do see pin 13? It's right beside the pin labeled GND. The picture you're using has some drawn reference labels, but that's for OSC (Open Sound Control) protocol, not a general Arduino reference...

OOOO, well that explains a lot, I was confused, didn't understand well, but now i do , thanks a lot, if I have more questions about the arduino, can i PM you or ask you here on the forum? Thanks

PM or forum is fine. You'll get more opinions on the forum, however. I've done a bit of work with the AVRs (the microcontrollers that the arduino are based upon), but instrutable user westfw is the go-to person for Arduino info.

Contact him for info on the Arduino programming language, especially...

Ok, I will bug westfw whit my questions, haha :) Thanks!

Oh my; someone mentioned my name, and Arduino, and I didn't notice...
As someone said, this looks less like an actual Arduino question, and more like a question on "conventions of electronics circuits." Usually, unless specifically noted otherwise, one lead of a "device" connected to a microcontroller will be connected to a microcontroller pin, and the other pin will be connected to "Ground" for the circuit.

In the case of the LED Blink example that uses pin13 as an output, there is a convenient GND socket right next to the pin13 socket, so you can plug in an LED really easily, As shown in this tutorial

Pre-"diecimila" Arduinos (such as yours, which looks like an "NG") have a built-in resistor on pin 13, so you shouldn't need any parts other than the LED. Diecimila and later arduinos tend to have a built-in LED on pin 13, so you don't even need an LED to do the basic testing/tutorial. In any case, it seems to be relatively safe to drive an LED from an Arduino pin without any resistor, although it has to remain "officially not recommended."

Thanks! Thanks a lot for helping me! If I have some more questions about the Arduino I will ask the expert, you!!! Thanks! :)

No, actually, I am planing to buy the arduino from make shead, I want to learn more about micro controllers...


9 years ago

Hmm. Rereading your question, I think there's some basic confusion about how electronics operate. You seem to be confusing input and output with current source or current sink (positive and gnd voltage levels.)

-- INPUT: an external signal that's connected to a pin; it's value is read by the arduino (AVR)-- a button, or other external device.

-- OUTPUT: a signal that's generated inside the arduino; it's value is written to the pin.

Both inputs and outputs can read/write a + / - (HI / LOW) value.

In this example, there isn't an input. Pin #13 is output only. It fluctuates between a HI and a LOW state depending on where in the loop it is, at a particular time.

The LED is connected to GND (via the resistor.) When pin 13 is LO, both ends of the LED are the same voltage (zero), and no current flows. When pin 13 is HI, there's a voltage differential and the current flows, lighting the LED...

So the shorter pin of the LED (-) i connect to the ground and the longer (+) to pin 13 ???

Yes, but you should add a current-limiting resistor, too--just like the schematic. Something like: Pin 13 --> 1K resistor --> LED --> GND pin. (Since there are different LEDs, AND there are Arduinos with both 3.3V and 5V supplies, I can't tell you for sure which resistor to use. But you can't fry the LED or the board with the 1K value. It just might be a little dim with a 3.3V board.) Have you tried the demo program as-is, just to see if one of those SMD devices on the board is an LED connected to #13?

What program? Can you please give me the link, I find lots of different information when i google search as-is program.
So you say, to be shore I should attach a 1k resistor to pin 13?
What about the power to arduino, does refill or what, where does it get the power needed to light up an LED???

I find lots of different information when i google search as-is program.


Sorry--I was referring to the demo program above...

And as-is refers to an unmodified Arduino board and the unmodified Blink demo program--i.e., maybe you already have the LED, but don't know it...

So, I'm just saying--load the blink demo code into your board and see what happens.

What about the power to arduino, does refill or what, where does it get the power needed to light up an LED???

I'm certain that the Arduino can be powered both by the USB port OR by an external power source. I.E., for testing, just connect it to the port.

So you say, to be shore I should attach a 1k resistor to pin 13?

Between pin #13 and the LED. As I said, you can look at the Diecimila schematic PDF...oh, heck, I'll just copy it to a pic....

OK, the LED circuit is highlighted in blue. Notice that it's connected to pin 13--but before the input / output connector--it doesn't matter where that connection is made, so long as there's nothing else between. Copy this circuit, and you'll be fine...


haha cool, THANKS A LOT!!!!