     }
 
     // Read inputs
-    int upVal = digitalRead(UP_PIN);
-    int rightVal = digitalRead(RIGHT_PIN);
-    int downVal = digitalRead(DOWN_PIN);
-    int leftVal = digitalRead(LEFT_PIN);
+    int upVal = analogRead(UP_PIN);
+    int rightVal = analogRead(RIGHT_PIN);
+    int downVal = analogRead(DOWN_PIN);
+    int leftVal = analogRead(LEFT_PIN);
 
     // Confirm that there was no previous button press (so we don't respond too many times)
     if (!buttonPressed) {
         // Make a move
-        if (upVal == HIGH) {
+        if (upVal) {
             buttonPressed = true;
             makeMove(UP);
         }
-        else if (rightVal == HIGH) {
+        else if (rightVal) {
             buttonPressed = true;
             makeMove(RIGHT);
         }
-        else if (downVal == HIGH) {
+        else if (downVal) {
             buttonPressed = true;
             makeMove(DOWN);
         }
-        else if (leftVal == HIGH) {
+        else if (leftVal) {
             buttonPressed = true;
             makeMove(LEFT);
         }

        return false;
    }

    // Otherwise, it was valid, so add a new tile
    // TODO

    return true;
}

    }

    // Whoops, we lost the game
    gameInProgress = false;
    Serial.println("L");
}

/****************************************
 ********** DISPLAY  METHODS ************
 ****************************************/

byte colors[8] = {7, 6, 4, 5, 1, 3, 2, 0};

byte color(int tileNum) {
    tileNum -= 1;
    int i = tileNum / 4;
    int j = tileNum % 4;
    int value = board[i][j];
    return colors[value];
}

void renderBoard() {
    byte A = color(15) % 2     << 0
           + color( 1)         << 1
           + color( 2)         << 4
           + color( 3) % 2     << 7;

    byte B = color(15) % 4 / 2 << 0
           + color( 3) / 2     << 1
           + color( 4)         << 3
           + color( 5) % 4     << 6;

    byte C = color(15) / 4     << 0
           + color( 5) / 4     << 1
           + color( 6)         << 2
           + color( 7)         << 5;

    byte D = color(16) % 2     << 0
           + color( 8)         << 1
           + color( 9)         << 4
           + color(10) % 2     << 7;

    byte E = color(16) % 4 / 2 << 0
           + color(10) / 2     << 1
           + color(11)         << 3
           + color(12) % 4     << 6;

    byte F = color(16) / 4     << 0
           + color(12) / 4     << 1
           + color(13)         << 2
           + color(14)         << 5;

    digitalWrite(LATCH_PIN, LOW);
    shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, F);
    shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, E);
    shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, D);
    shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, C);
    shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B);
    shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, A);
    digitalWrite(LATCH_PIN, HIGH);
 }

/* Prints board to serial. For debugging. */
void printBoard() {
    for (int i = 0; i < 4; i++) {
        for (int j = 0; j < 4; j++) {
            Serial.print(board[i][j]);
