Questions tagged [pins]

"Pins" are like gateways between the Arduino code running on the chip and the components attached to Arduino. It can refer either to the physical connectors on the board, or it can refer to the pins defined in the code.

"Pins" are like gateways between the Arduino code running on the chip and the components attached to Arduino. It can refer either to the physical connectors on the board, or it can refer to the pins defined in the code.

There are three main types of pins:

  • A digital pin is one that can detect and output a digital signal (i.e. either HIGH or LOW)
  • An analog pin works mostly like a digital pin, except that each one of them also includes an ADC (analogue to digital converter) which can give the Arduino values of 0 to 1024 that is proportional to the input voltage (i.e. 2.5V on a 5V board is 512).
  • A PWM pin (pulse width modulation) is a digital pin that can create a signals that goes on and off very fast. This can be used to create a dimming effect. For more questions related to PWM, see .

A pin can also refer to the physical pin header that you connect wires to. Connect the wire to the GND pin.

Arduino Uno

From http://arduino.cc/en/Main/ArduinoBoardUno

In the photo above, there are 14 digital pins (six of those are PWM), 6 analog pins, and 12 other pins (GND, 5V, 3.3V, etc.).

477 questions
9
votes
3 answers

How to read pinMode for digital pin?

Is there a way for me to read the pin mode for one of the digital pins on Arduino? In other words, can I determine whether a pin's been set to an input or output?
John
  • 213
  • 2
  • 4
5
votes
1 answer

Can I damage an arduino by setting pins high with no load

I have an Arduino project that has 15 different output pins set. Some are currently attached to devices and others are not. Will testing my program cause a problem / damage if it sets pints to HIGH that do not have anything connected to them?
Hoytman
  • 747
  • 5
  • 13
  • 26
5
votes
3 answers

How to get number of available pins in code?

Different boards have different number of pins. Is there a way to know this number in code (at least digital and analog pins), or do I have to determine board type (like in this thread) and know the number of pins by myself? Reasoning for this is…
madneon
  • 225
  • 1
  • 3
  • 9
5
votes
4 answers

Is there any way I can turn off the 5V pin?

I'm trying to find a way I can toggle the 5V pin to turn on/off. I want the voltage to pass to another wire at a certain point. It should be off and then when something happens, the 5V should turn on. How can I do this?
ninesalt
  • 159
  • 1
  • 1
  • 2
3
votes
3 answers

Use same ground with 2 wires?

So I have 3 ground pins, but I need 4 motors on my Arduino. Can I connect multiple motors to the same ground pin?
3
votes
2 answers

How to toggle a pin (LED) simply

I am not a programmer but rather a hardware guy. In the good old machine code days, you could 'read' the status of the port and flip it.. admittedly a much simpler processor. Is it not possible to do this with the 328 without many lines of code?
Colin
  • 41
  • 1
  • 2
3
votes
2 answers

why does it use A0 to define analog pin 0 in some case and why use 0 directly?

https://www.arduino.cc/en/Tutorial/AnalogInput https://www.arduino.cc/en/Tutorial/Knob For first line of both examples(not in comments), it define the same pin, analog pin 0, but they use different values. why and can use A1, A2, etc. to define…
Victor He
  • 123
  • 2
  • 6
2
votes
2 answers

Input vs input_pullup

I'm a beginner in Arduino and can't understand some things. How does input pin in Arduino work? I want to set one of the pins as input. When should I use input and when input_pullup? What are the differences between them?
Maciaz99
  • 41
  • 1
  • 3
2
votes
1 answer

Is my Arduino destroyed or are the pins destroyed?

I made a working model of Bluetooth light control with arduino and Bluetooth. Everything worked fine and then after some time I connected the circuit again it didn't work and the pins 7,10,11,12 aren't working . I was using a Bluetooth shield but I…
Kam
2
votes
2 answers

Checking a jumper between two pins on Arduino

I'm in the process of making a tag scanner (which transfers the tag ID to the computer), and I figured I'd use an Arduino Micro for that and just use the keyboard function on it to save myself a whole lot of hassle. From what I've read, however,…
Toll
  • 31
  • 1
  • 4
2
votes
1 answer

Is it safe to short two pins together for conditioning a sketch?

I want to make a sketch which behaves differently, i.e.: pinMode(pin1, OUTPUT); digitalWrite(pin1, HIGH); pinMode(pin2, OUTPUT); digitalWrite(pin2, LOW); pinMode(pin3, INPUT); // And a user decides to short pin3 with pin1 or pin2 if…
Jeon
  • 123
  • 1
  • 7
2
votes
2 answers

Grouping multiple pins to one variable

I'm new to all of this, but it's there a way to group a cluster of pins to one variable? I don't necessarily want the grouped pounds to be sequential.
Erik
  • 21
  • 1
2
votes
1 answer

What is GND on board?

I've looked in several places, and so far can not understand to want to be the GND who is on the board. There is this documented anywhere?
Fuechter
  • 123
  • 1
  • 4
1
vote
1 answer

Simultaneous input output in arduino mega

I need to read 5 analog pins simultaneously , is it possible? note that: analogRead(1); analogRead(2); analogRead(3); will not work this case
Omar Faruk
  • 11
  • 1
1
vote
1 answer

pin numbering for non-standard chips

so i replaced the mainboard in (what was) an anet a8 3d printer with a proper RAMPS setup. there was nothing wrong with it, (or at least it wasnt damaged, there are a number of severe design flaws) so i thought it might be a good start point for a…
1
2 3