 extern int ychOledMax; // defined in OrbitOled.c
 
 // Local variables
-char    key;
+int   inputLength;
+String input;
 char	chSwtCur;
 char	chSwtPrev;
 bool	fClearOled;

  // Configure all components of Orbit Booster Pack

  // For OLED display, the only method req'd is OrbitOledInit()
//  DeviceInit();
  
  // Initialise to bus 1
  bus = TwoWire(1);
  bus.begin(2);
  bus.onReceive(receiveEvent);
}

void receiveEvent(int howMany){
  char c;
  while (bus.available()){
    c = bus.read();
    Serial.print(c);
  }

  Serial.println();
}

void DeviceInit()

  // after each other (no spaces)

  OrbitOledSetCursor(0, 0);
  OrbitOledPutString("Enter WatID #: ");

  // Back button == *
  // Handles back button and erases last character
  if(key == '*'){
    if(inputLength > 0)
      inputLength--;
    input.remove(inputLength);
  }
  else if (key != '\0'){
    input += key;
    inputLength++;
  }

  // Print out current input String
  OrbitOledSetCursor(0,1);
  char stringBuffer[inputLength];
  // Serial.println(input);
  input.toCharArray(stringBuffer, (inputLength+1)*sizeof(char));
  OrbitOledPutString(stringBuffer);

  // Set display to clear next iteration
  fClearOled = true;
}




