How to use more digital pins on Arduino Uno
I need more digital input/output pins on Arduino Uno. How to increase digital pins on Arduino Uno?
Answer
There are several way to add more digital input/output pin on Arduino Uno:
- Use analog pins as digital pin: pins A0 to A5 can be used as dogital input/output pin. For example:
void setup() {
pinMode(A5, OUTPUT); // sets the digital pin A5 as output
}
void loop() {
digitalWrite(A5, HIGH); // sets the digital pin A5 on
delay(1000); // waits for a second
digitalWrite(A5, LOW); // sets the digital pin A5 off
delay(1000); // waits for a second
}
- Use an IO Expander module: for example PCF8574
Buy Arduino
1 × Arduino UNO Buy on Amazon | |
1 × USB 2.0 cable type A/B Buy on Amazon | |
1 × Jumper Wires Buy on Amazon |
Please note: These are Amazon affiliate links. If you buy the components through these links, We will get a commission at no extra cost to you. We appreciate it.