USING PIN 0 and PIN 1
Pin 0 and pin 1 on the Arduino are usually used for communication between the Arduino and your computer.
You can use these pins as digital input or output as long as you’ve completed troubleshooting your project because you cannot use Serial Monitor.
Things to remember
- Do not use Serial Monitor.
Serial.println()will use pins 0 and 1 and will interfere with your program.
- Disconnect pin 0 and 1 when uploading.
Your computer uploads your program using pins 0 and 1. If you have anything connected to these pins, your program will not upload successfully
USING A0 TO A5 AS DIGITAL IO PINS
Usually for digital pins, we write
digitalWrite(13, HIGH). To do that with analogue pins, simply use digits 14 to 19.
Pin 14 being A0, pin 15 being A1, and so on. For example, you could write
digitalWrite(14, HIGH), or you can also write
digitalWrite(A0, HIGH). Both do the same thing.