 #include <DS3231.h>
 #include <SPI.h>
 #include <SD.h>
+#include <sha1.h>
 
 #define BUTTON_PIN 42
 #define SD_PIN 4
 #define KEY_FILE "key.txt"
+#define INTERVAL 30
+#define TOKEN_LENGTH 6
 
 DS3231 rtc(SDA, SCL);
-String key = "";
+uint8_t key[20];
 int previousButtonState = HIGH;
 
 // Gets a UNIX timestamp from the RTC

    Serial.println("SD card has no key.txt");
    return;
  }
  while (keyFile.available()) {
    char ch = keyFile.read();
    if (ch == ' ' || ch == '\n') continue;
    key.concat(ch);
  }
  keyFile.close();

  // Set up the keyboard
  Keyboard.begin();

  if (Serial.available()) {
    command();
  } else if (buttonState == HIGH && previousButtonState == LOW) {
    char token[TOKEN_LENGTH];
    totp(key, 20, getTimestamp(), token);
    Keyboard.print(token);
  } else {
    delay(100);
  }
