       case 'R': // Read EEPROM contents
          state = READ;
          addr  = 0x0000;
-         data  = 0x00;
          wait  = false;
          setReadMode();
          digitalWrite(WRITE_LED, LOW);

   pinMode(CHIP_PIN,   OUTPUT);
   pinMode(WRITE_LED,  OUTPUT);
   pinMode(READ_LED,   OUTPUT);
   digitalWrite(READ_PIN,   HIGH);
   digitalWrite(CHIP_PIN,   HIGH);
   digitalWrite(WRITE_PIN,  HIGH);

   Serial.begin(9600);
}

         wait = true;
         return;
      case 'W': // Write data to EEPROM 
         // Don't accidentally write anything sent so far to the chip
         while (Serial.available() > 0) {
            Serial.read();
         }
         state = WRITE;
         addr  = 0x0000;
         wait  = false;
         digitalWrite(WRITE_LED, HIGH);
         digitalWrite(READ_LED, LOW);
