From 8c88c19cb160285c385596905843b3700e1723b1 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Mon, 2 Mar 2015 14:11:36 -0800 Subject: [PATCH] Refactor setup a bit --- ArduinoKeyboard.ino | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ArduinoKeyboard.ino b/ArduinoKeyboard.ino index 9a0dc24b..ec78b500 100644 --- a/ArduinoKeyboard.ino +++ b/ArduinoKeyboard.ino @@ -466,12 +466,19 @@ void release_key(Key mappedKey){ // Hardware initialization void setup_pins() { + setup_output_pins(); + + setup_input_pins(); +} + +void setup_output_pins() { //set up the row pins as outputs for (byte row = 0; row < ROWS; row++) { pinMode(rowPins[row], OUTPUT); digitalWriteFast(rowPins[row], HIGH); } - +} +void setup_input_pins { for (byte col = 0; col < COLS; col++) { pinMode(colPins[col], INPUT); digitalWriteFast(colPins[col], HIGH);