[Solved] Questions on plugging a button matrix

Very simple question :
Will doing this damage my arduino due board if I'm reading the 53 pin as an input?

I am wondering about this because of a button panel and I'm worrying about short circuiting something that way.
If it will damage the board, how to prevent from that? A resistor?

The product page for the Due says

Unlike other Arduino boards, the Arduino Due board runs at 3.3V. The maximum voltage that the I/O pins can tolerate is 3.3V

so you should be OK

I just thought I wasn't going to use 3.3V because I actually have a 4x4 button panel with 8 pins.
Pins 1..4 are defining the vertical row while 5..8 are defining the horizontal row.
I'd plug 5..8 as an output and 1..4 as an input and check 1..4 inputs for every vertical row.

So, new question, will shorting an output pin to an input pin damage the board? (Hope that's the last question on the matter, haha).

will shorting an output pin to an input pin damage the board?

No. The output pin will either be a 0V or 3.3V which is safe.

You might find this helpful Arduino Playground - HomePage

Alright - Got it working without damaging anything as excepted.
I've wrote a very simple lib instead of using keypad's. Here's the source if you're interested.

// Main code

[...]

// in the main

  for (unsigned i=0; i<keyboard_height; i++)
  {
    pinMode(ver_pins[i], INPUT);
  }
  
  for (unsigned i=0; i<keyboard_width; i++)
  {
    pinMode(hor_pins[i], OUTPUT);
    digitalWrite(hor_pins[i], LOW);
  }

[...]

// KeyboardInput.h

#ifndef KEYBOARD_INCLUDE
#define KEYBOARD_INCLUDE

const unsigned keyboard_width = 4;
const unsigned keyboard_height = 4;

const unsigned hor_pins[keyboard_width] = { 49, 48, 50, 52 };
const unsigned ver_pins[keyboard_height] = { 47, 49, 51, 53 };

bool keysPressed[keyboard_width][keyboard_height];

void updateKeys()
{
  for (unsigned i=0; i<keyboard_width; i++)
  {
    digitalWrite(hor_pins[i], HIGH);
    for (unsigned j=0; j<keyboard_height; j++)
    {
      if (digitalRead(ver_pins[j]) == HIGH)
        keysPressed[i][j] = true;
      else
        keysPressed[i][j] = false;
    }
    digitalWrite(hor_pins[i], LOW);
  }
}

#endif

The issue I'm getting is a random noise when reading the input.
I knew that was a thing but I have no idea how to fix it because because of that the input is barely usable.
Since that's most likely due (pun not intended) to how arduino read input, is there any way to fix it? I know there should be a resistor connected to the ground (or something like that), but I'd bet I'd destroy a pin (pardon my paranoïd brain, ehe) and I don't think I can do it with those buttons?

[spoiler][/spoiler]

INPUT_PULLUP is the first thing to try.

MorganS:
INPUT_PULLUP is the first thing to try.

Thank you, it's working fine now.
I'll improve a bit my library to make it working with INPUT_PULLUP, because until i'm pressing a key on the row all its row is taken as on.

Thank you again helping me :slight_smile: