Sainsmart LCD Keypad Shield -- Code to help use keypad?

Here is some code I wrote quick to get the reading of the 'A0' pin on my Sainsmart LCD Keypad Shield.

I'm hoping this code helps others how the keypad works, and perhaps will help integrate the keypad into some more understandable / newbie-friendly coding and projects.

Here's the code!

//
//Program: Sainsmart_LCD_Button_Readings
//
//Author: Jester_Baze
//
//Requires: -Sainsmart LCD Keypad Shield
//          -Arduino Uno R3
//
/*
 This program shows the value of the reading
 taken from pin A0 then displays it on the
 LCD shield. Hopefully this code is easier
 to digest than some of the google results.
 
 This is designed to make the Sainsmart LCD 
 Keypad Shield more newbie friendly.
 
 Hope this helps!
*/

#include <SPI.h>
#include <LiquidCrystal.h>

//Define your lcd pins
LiquidCrystal lcd( 8, 9, 4, 5, 6, 7 );

//Some notes I took...
//Mapped & Analog readouts from "A0" -- Keypad input
/*
 Nothing pressed = 100 or 1023
 'Select'        - 72 or 743
 'Left'          - 49 or 507
 'Right'         - 0 or 0
 'Up'            - 14 or 145/146
 'Down'          - 32 or 331
*/

void setup()
{
 lcd.begin(16,2);        //'16,2' is 16 columns, 2 rows on the display
 Serial.begin(9600);
 pinMode(A0, INPUT);     //pin 'A0' is your keypad's input.
}
 
void loop()
{
 //Read the A0 keypad pin
 int keypadInput = analogRead(A0);
 
 //Map it to a number between 0-100
 int keypadRead = map(keypadInput, 0, 1023, 0, 100);
 
 //Display the readings on the keypad
 Serial.println(keypadInput);
 lcd.print("Mapped: ");
 lcd.print(keypadRead);
 
 //Move the cursor down to line two
 lcd.setCursor(0,1);
 lcd.print("Actual: ");
 lcd.print(keypadInput);
 lcd.setCursor(0,0);
 
 //To help things work nice and pretty-like =)
 delay(150);
 lcd.clear();
}

Thank you for that code. It popped up first in my Google search and worked fine for me. FWIW, here is my variation, where the goal is to classify and name the button on the screen.

// lcd_shield_test

// based on code from Jester_Baze, with modifications by John Jensen.

#include <SPI.h>
#include <LiquidCrystal.h>

// lcd pins
LiquidCrystal lcd( 8, 9, 4, 5, 6, 7 );

void setup()
{
  Serial.begin(9600);
  Serial.println("reset!");
  lcd.begin(16,2);        // '16,2' is 16 columns, 2 rows on the display
  pinMode(A0, INPUT);     // keypad's input.
}

#define noise_value 5
#define select_value 639
#define left_value 410
#define right_value 0
#define up_value 98
#define down_value 255

int lastValue = 0;

void loop()
{

  int value = analogRead(A0);

  if (noise_value < abs(lastValue - value)) {

    Serial.println(value);

    lcd.clear();
    lcd.setCursor(0,0);
    if (noise_value > abs(select_value-value)) {
      lcd.print("Select");
    }
    else if (noise_value > abs(left_value-value)) {
      lcd.print("Left");
    }
    else if (noise_value > abs(right_value-value)) {
      lcd.print("Right");
    }
    else  if (noise_value > abs(up_value-value)) {
      lcd.print("Up");
    }
    else if (noise_value > abs(down_value-value)) {
      lcd.print("Down");
    }
    else {
      lcd.print("Ready");
    }

    lastValue = value;
  }

}

Hey guys,
this code runs fine. I tried one from the saintsmart homepage that comes with its own libary, but I like this smaller version more.

I wonder what the SPI.h libary does in this sketch? I left it out and the code still runs :o
Am I wrong or is it redundant?