Skip to content

Header Pins Test

HeaderPinsTest.ino tests the expansion header pins by initializing them as outputs and turning them each HIGH and LOW for 1s. I connected a 3V capable LED to each pin and GND to check if it would blink. If it does on each pin, you know all pins on the header work.

Some of the pins on the expansion header are shared with the SPI connection to the LCD screen. These pins can be used, but you must ensure there are no conflicts when sending data to the screen.

HeaderTest.ino
#define h1 11
#define h2 12
#define h3 13
#define h4 34
#define h5 33
void setup() {
Serial.begin(115200);
Serial.println("STARTED");
pinMode(h1, OUTPUT);
pinMode(h2, OUTPUT);
pinMode(h3, OUTPUT);
pinMode(h4, OUTPUT);
pinMode(h5, OUTPUT);
digitalWrite(h1, LOW);
digitalWrite(h2, LOW);
digitalWrite(h3, LOW);
digitalWrite(h4, LOW);
digitalWrite(h5, LOW);
}
void loop() {
digitalWrite(h1, HIGH);
delay(1000);
digitalWrite(h1, LOW);
delay(1000);
digitalWrite(h2, HIGH);
delay(1000);
digitalWrite(h2, LOW);
delay(1000);
digitalWrite(h3, HIGH);
delay(1000);
digitalWrite(h3, LOW);
delay(1000);
digitalWrite(h4, HIGH);
delay(1000);
digitalWrite(h4, LOW);
delay(1000);
digitalWrite(h5, HIGH);
delay(1000);
digitalWrite(h5, LOW);
delay(1000);
}