Can I use Digital Pins 0 and 1?

Can I use digital pins 0 and 1? All but 13, 0, and 1 pins are already used. I'm in need of 2 more pins for output. Is it possible for me to use those pins? (0, & 1)

Sure. Just can't do Serial comm's if you do.
If you need to do Serial upload afterwards, may need to press & hold Reset until IDE shows "Compiled xxx of 32xxx bytes" to keep Arduino from jamming the serial port.
May take a couple of tries to get the timing right.

Easier to see when that occurs by clicking Verbose Outputs under File:Preferences.

Have you also used up all the analog input pins? They too can be used as digital input or output pins.

Lefty

guuwey:
Can I use digital pins 0 and 1? All but 13, 0, and 1 pins are already used. I'm in need of 2 more pins for output. Is it possible for me to use those pins? (0, & 1)

The other way is to have a switch to isolate pins 0 & 1 during upload and then switch it over to run your code.

CrossRoads:
If you need to do Serial upload afterwards, may need to press & hold Reset until IDE shows “Compiled xxx of 32xxx bytes” to keep Arduino from jamming the serial port.
May take a couple of tries to get the timing right

There was me thinking that the whole point in having an auto-reset was that the chip is reset to the bootloader before programming (i.e. your last program is NOT running).

There is no problem using pins 0 and 1 as long as you don’t need Serial in your application.

There is no problem using pins 0 and 1 as long as you don't need Serial.

Which you need for uploading code.

Yes, but after uploading code, they can be used as outputs if Serial comms are not needed, such as in an embedded application. And if the program is running, a manual reset will ensure the bootloader is running.

I can hardly understand what you guys are saying. >.<

Is the Digital and Analog pins have the same syntax? The only thing that is connected to my analog pins are 4 & 5 for SDA & SCL.

I can hardly understand what you guys are saying.

Don't worry, we are just violently agreeing with each other 8)

Analog & Digital have same syntax. I use D14 to D19, others just use A0 to A5. Both work.

Okay, I was able to make it work. Thanks for the replies! :slight_smile:

guuwey:
I can hardly understand what you guys are saying. >.<

Is the Digital and Analog pins have the same syntax? The only thing that is connected to my analog pins are 4 & 5 for SDA & SCL.

Basically the same syntax, just different pin names in the statements.

pinMode(A0, INPUT);
digitalRead(A0); will utilize analog input pin 0 as a digital input pin
pinMode(A0, OUTPUT);
digitalWrite(A0, HIGH); will utilize analog input pin 0 as a digital output pin setting it HIGH

guuwey:
Is the Digital and Analog pins have the same syntax? The only thing that is connected to my analog pins are 4 & 5 for SDA & SCL.

Which - considering that SDA and SCL are themselves, clearly digital functions, should have been a very strong hint. :smiley:

guuwey:
I can hardly understand what you guys are saying. >.<

So to get the most out of this forum you ask about the bits in a reply that you don’t understand and that will be explained to you.

Its fine now. After doing some research, I was able to understand those replies (e.g. Serial Comms)

Can I use digital pins 0 and 1? All but 13, 0, and 1 pins are already used. I'm in need of 2 more pins for output. Is it possible for me to use those pins? (0, & 1)

Of course next week you will need yet 2 more :slight_smile:

You should also consider the famous shift registers 165 & 595.
For example Arduino Playground - ShiftRegSN74HC165N
Since shift registers cascade you can get 8,16,24,32,..,.. inputs(or outputs) for only 3 pins.

Of course you lose some speed but this is often insignificant. Many people seem to think that shift registers are only suited to banks of led's or switches - not true. For example, motor shields often use the 595 to save pins when controlling 2-4 motors.

guuwey:
Its fine now. After doing some research, I was able to understand those replies (e.g. Serial Comms)

Excellent, that's the sort of attitude we like round here a lot. :slight_smile: :slight_smile: :slight_smile: