Go Down

Topic: Pins 0 and 1 for LED (Read 218 times) previous topic - next topic

knomax

Hi all,

I was trying to run a LED on the pin 0 and also on the pin 1. The LED on pin 0 doesn`t work, on pin 1 it works fine.
Now my question is what does the RX on pin 0 and the TX on pin 1 means exactly, because I haven`t found a good explanation.
The problem is that I have no more pins left on my arduino uno to control the LEDs with another pin.

Thank you in advance for your help.
knomax

knomax

Ok, in my application it also doesn`t work on pin 1.  :smiley-mad: 

pert

In addition to being standard digital pins, pins 0 and 1 have hardware serial communication capability. The RX stands for "receive" the TX stands for "transmit". On most of the AVR-based Arduino boards (e.g. Uno, Mega, Nano, Pro Mini), these pins are used for uploading sketches to your board and also for communication with the Serial Monitor. On the native USB boards like Leonardo, pro micro, etc. pins 0 and 1 are still hardware serial but they are not used for communication with the computer. Connecting things to pins 0 and 1 on the non-native USB boards like your Uno can interfere with serial communication with the computer and cause you to not be able to upload sketches so it's usually best to leave them alone. It is possible to use them as standard digital pins as long as you aren't also using Serial.

Did you know that the pins A0-A5 can be used as digital pins as well as analog inputs? If you haven't used all of those pins up then I recommend using them instead of 0 and 1.

Wawa

#3
Oct 17, 2018, 01:49 am Last Edit: Oct 17, 2018, 01:50 am by Wawa
It is possible to use them as standard digital pins as long as you aren't also using Serial.
Problem (on an Uno) is that the USB<>Serial chips pulls the pins HIGH, even if you don't call Serial.begin().
Just measured a pull up of 7.8mA for pin0 and 3.2mA for pin1 without Serial.begin().
Meaning you can only sort off use the pins as outputs, not as inputs.
Best to avoid pin 0 and 1.
Leo..

CrossRoads

#4
Oct 17, 2018, 05:30 am Last Edit: Oct 17, 2018, 05:31 am by CrossRoads
Just means that whatever is driving 0 and 1 needs to be able to pull the pins low with a little bit of current sinking. 8mA is not much to overcome.
The '328P with its 20mA nominal high & low current drive capability can certainly drive an LED on and off.  Don't forget to use current limit resistors.

You can also drive LEDs from the analog pins, many beginners seem to not be aware of that.
A0 to A5 can be treated in the code as D14 to D19, and used just like D0 to D13.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Paul__B

So in short, don't use pins 0 or 1 - it is very unlikely you would need to, so if you think you do, explain here first.

You can't use them if you are using the serial interface for your program.  :smiley-eek:

And in any case you must disconnect anything external from them in order to upload code.

Silente

Pins 0 and 1 are used for programming Arduino. If youbuse that you may can't program Arduino anymore. Are you sure that your code is right?
And anither problem can be the electric power, because if you can't change led pins in means that you use all the Arsuino pins. Arsuino can be not able to give all the tension needee by all pins, so your project can doesn't work
Dove va un numero va una variabile o una funzione. E dove va una boolean va un insieme di test.

Se vuoi ottenere devi saper spiegare

In pichi capiscono l'importanza di formattare, sii tra di essi

Go Up