 
 //------------------------------------------------------------------------------
 
+int getButtonInput() {
+  return (digitalRead(BUTTON) == HIGH) ? LOW : HIGH; //switch high and low because it's a pullup
+}
+
+//------------------------------------------------------------------------------
+
+int getJoystickInput()
+{
+  int joystickState = analogRead(3);
+  
+  if (joystickState < 650) {
+    return HIGH;
+  } else {
+    return LOW;
+  }
+}
+
+//------------------------------------------------------------------------------
+
+int getInput() {
+  #ifdef TFT_DISPLAY
+    return getJoystickInput();
+  #else
+    return getButtonInput();
+  #endif
+  
+}
+
+//------------------------------------------------------------------------------
+
+void outputCharacter(char character) {
+  Serial.print(character);
+  
+  #ifdef TFT_DISPLAY
+    tft.print(character);
+  #endif
+}
+
+//------------------------------------------------------------------------------
+
+void outputString(String string) {
+  Serial.print(string);
+  
+  #ifdef TFT_DISPLAY
+    tft.print(string);
+  #endif
+}
+
+//------------------------------------------------------------------------------


//------------------------------------------------------------------------------

int determineDotDash(unsigned long holdMillis);
int determineLetterWordSpace(unsigned long spaceMillis);
String getDotDashOrSpaceString(int input);

//------------------------------------------------------------------------------

void loop() {
  inputVal = getInput();
  
  digitalWrite(LED, inputVal);

  if (inputVal == HIGH && previousInputVal == LOW) {
