   Wire.endTransmission();
 
   // Reset the current
-  setDisplayPowerMax(Digits);
-}
+  setDisplayPowerMax(digits);
+}
+
+/**
+ * Dims the display
+ *
+ * Parameters:
+ * digits Selects the display to set the current, 4 = 4 digit display and all
+ *        others = 6 digit display
+ * PWM    Sets the dimming level, not very linear. 0x80 = full intensity,
+ *        0x00 is off
+ */
+void setDisplayBrightness (int digits, byte PWM) {
+  // TODO Allow user setting in percentage with 100% being the useful register
+  // value of 128 (0x80)
+
+  setupWireTransmission(digits);
+
+  // Begin dimming the display
+  Wire.write(IS31FL3730_PWM_Register); // Lighting Effect Register
+
+  // Do not allow the user to set values higher than the max allowed (always on)
+  if (PWM < 0x80)
+  {
+    // Value is less than the max, set the requested value
+    Wire.write(PWM); // write the value that was requested
+  }
+  else
+  {
+    // Value is higher than the max, set the max
+    Wire.write(0x80); // write the max value allowed (always on)
+  }
+
+  Wire.endTransmission();
+}
+
+/*
+ * Prints the characters to the selected display. The only characters allowed
+ * are numbers 0-9 and letters A, b, C, d, E, and F
+ */
+void print(int digits, char value[])
+{ 
+  // User can technically give us any digit, so we have to do a nice
+  // conversion with that data so that we can use it for proper iteration
+  if (digits != 4)
+  {
+    digits = 6;
+  }
+
+  // Write the display data in the temporary registers
+  setupWireTransmission(digits);
+  Wire.write(IS31FL3730_Data_Registers);
+  
+  // Iterate over the print value and print out the individual characters
+  // Any string that goes over the number of digits gets cut off
+  // Any string that goes under the number of digits has blank spaces in
+  // in the remaining spots
+  for (int i = 0; i < digits; i++)
+  {
+    Wire.write(charToDisplayByte(value[i]));
+  }
+
+  // End the temporary register transmission
+  Wire.endTransmission();
+
+  // Transfer the display data from the temporary registers to the display
+  setupWireTransmission(digits);
+  
+  // Write to the Update Column Register to let the board know we want to
+  // update the display
+  Wire.write(IS31FL3730_Update_Column_Register); 
+  
+  // Send any value to initate the display (value ignored)
+  Wire.write(0x00);
+
+  // End the Updte Column Register Transmission
+  Wire.endTransmission();
+}
+
+/*
+ * Arduino Overall Looping Function
+ */
+void loop() {
+  print(4, "01");
+  delay(500);
+  print(6, "HE110");
+  delay(500);
+  resetDisplay(4);
+  delay(500);
+  resetDisplay(6);
+  delay(500);
+}
+
+
+/******************************************************************************
+ *                           Arduino Helper Methods                           *
+ ******************************************************************************/
 
 /*
  * Sets the current to the minimum (5mA per segment)
- * 
- * Parameters:
- * Digits Selects the display to dim, 4 = 4 digit display and all others = 6 digit display
- */
-void setDisplayPowerMin(int Digits) 
-{
-  // Set up the transmission depending on the display being reset
-  if (Digits == 4)
-  { 
-    Wire.beginTransmission(IS31FL3730_DIGIT_4_I2C_ADDRESS); 
-  }
-  else
-  { 
-    Wire.beginTransmission(IS31FL3730_DIGIT_6_I2C_ADDRESS); 
-  }
-  
+ *
+ * Parameters:
+ * digits Selects the display to set the current, 4 = 4 digit display and all
+ *        others = 6 digit display
+ */
+void setDisplayPowerMin(int digits)
+{
+  setupWireTransmission(digits);
+
   Wire.write(IS31FL3730_Lighting_Effect_Register);
   Wire.write(0x08); // Lowest level, 10mA
   Wire.endTransmission();
-}  
-
-/*
- * Sets the current to the maximum alllowed for these displays (0mA per segment)
- * 
- * Parameters:
- * Digits Selects the display to dim, 4 = 4 digit display and all others = 6 digit display
- */
-void setDisplayPowerMax(int Digits) {
-  /* The display driver does allow currents greater than the displays should take - do not allow tanything over 20mA!
-   * The display driver resets to 40mA per segment which is too much.  Somehow we need to make sure that is never
-   * violated but the part is write-only, so we need to keep track of the setting somewhere or just always force to the max current.
-   */
-
-  // Set up the transmission depending on the display being reset
-  if (Digits == 4)
-  { 
-    Wire.beginTransmission(IS31FL3730_DIGIT_4_I2C_ADDRESS); 
-  }
-  else
-  { 
-    Wire.beginTransmission(IS31FL3730_DIGIT_6_I2C_ADDRESS); 
-  }
-  
+}
+
+/*
+ * Sets the current to the maximum allowed for these displays (0mA per segment)
+ *
+ * Parameters:
+ * digits Selects the display to set the current, 4 = 4 digit display and all
+ *        others = 6 digit display
+ */
+void setDisplayPowerMax(int digits) {
+  // The display driver does allow currents greater than the displays should
+  // take - do not allow anything over 20mA!
+  // The display driver resets to 40mA per segment which is too much.  Somehow
+  // we need to make sure that is never violated but the part is write-only, so
+  // we need to keep track of the setting somewhere or just always force to the
+  // max current.
+
+  setupWireTransmission(digits);
+
   Wire.write(IS31FL3730_Lighting_Effect_Register);
   Wire.write(0x0B); // Highest level, 20mA
   Wire.endTransmission();
-}  
-
-/**
- * Dims the display
- * 
- * Parameters:
- * Digits Selects the display to dim, 4 = 4 digit display and all others = 6 digit display
- * PWM    Sets the dimming level, not very linear. 0x80 = full intensity, 0x00 is off
- */
-void setDisplayBrightness (int Digits, byte PWM) {
-  // Probably should rewrite to allow a user setting in percentage, so an integer and 0 to 100 map to 0 to 128.  
-  // Anything above 100 would be clamped to the max useful register value of 128 (0x80).
-
-  // Set up the transmission depending on the display being reset
-  if (Digits == 4)
-  { 
-    Wire.beginTransmission(IS31FL3730_DIGIT_4_I2C_ADDRESS); 
+}
+
+/*
+ * Set up the Wire transmission depending on the display being used
+ */
+void setupWireTransmission(int digits)
+{
+  if (digits == 4)
+  {
+    // Use the four digit display
+    Wire.beginTransmission(IS31FL3730_DIGIT_4_I2C_ADDRESS);
   }
   else
-  { 
-    Wire.beginTransmission(IS31FL3730_DIGIT_6_I2C_ADDRESS); 
-  }
-
-  // Begin dimming the display
-  Wire.write(IS31FL3730_PWM_Register); // Lighting Effect Register
-
-  // Do not allow the user to set values higher than the max allowed (always on)
-  if (PWM < 0x80)
-  { 
-    // Value is less than the max, set the requested value
-    Wire.write(PWM); // write the value that was requested
-  }
-  else
-  { 
-    // Value is higher than the max, set the max
-    Wire.write(0x80); // write the max value allowed (always on)
-  }
-  
-  Wire.endTransmission();
-}
-
-
-/*
- * Test Routine to force something interesting on the 4-digit display
- */
-void display_update_4a() {
-  // Write the display data in the temporary registers
-  Wire.beginTransmission(IS31FL3730_DIGIT_4_I2C_ADDRESS);
-  Wire.write(IS31FL3730_Data_Registers); // Matrix 1 Data registers
-  Wire.write(0x3F); // Digit 1 value (far left) -- Display "0"
-  Wire.write(0x5B); // Digit 2 value -- Display "2"
-  Wire.write(0x4F); // Digit 3 Value -- Display "3"
-  Wire.write(0x66); // Digit 4 value (far right) -- Display "4"
-  Wire.endTransmission();
-  
-  // Transfer the display data from the temporary registers to the display registers (display the values)
-  Wire.beginTransmission(IS31FL3730_DIGIT_4_I2C_ADDRESS);
-  Wire.write(IS31FL3730_Update_Column_Register); // Update Column Register
-  Wire.write(0x00); // Send any value to initate the display (value ignored)
-  Wire.endTransmission();
-}
-
-/*
- * Test Routine to force something interesting on the 4-digit display
- */
-void display_update_4b() {
-  // Write the display data in the temporary registers
-  Wire.beginTransmission(IS31FL3730_DIGIT_4_I2C_ADDRESS);
-  Wire.write(IS31FL3730_Data_Registers); // Matrix 1 Data Registers 
-  Wire.write(0xFF); // Digit 1 value (far left)
-  Wire.write(0x02); // Digit 2 value
-  Wire.write(0x04); // Digit 3 value
-  Wire.write(0x08); // Digit 4 value (far right)
-  Wire.endTransmission();
-  
-  // Transfer the display data from the temporary registers to the display registers (display the values)
-  Wire.beginTransmission(IS31FL3730_DIGIT_4_I2C_ADDRESS);
-  Wire.write(IS31FL3730_Update_Column_Register); // Update Column Register
-  Wire.write(0x00); // Send any value to initate the display (value ignored)
-  Wire.endTransmission();
-}
-
-/*
- * Test Routines to force something interesting on the 6-digit display
- */
-void display_update_6a() {
-  Wire.beginTransmission(IS31FL3730_DIGIT_6_I2C_ADDRESS);
-  Wire.write(IS31FL3730_Data_Registers); // Matrix 1 Data Registers 
-  Wire.write(0x06); // Digit 1 value (far left)
-  Wire.write(0x5B); // Digit 2 value
-  Wire.write(0x4F); // Digit 3 value
-  Wire.write(0x66); // Digit 4 value
-  Wire.write(0x6D); // Digit 5 value
-  Wire.write(0x7D); // Digit 6 value (far right)
-  Wire.endTransmission();
-  
-  // Now transfer the data from the temporary registers to the display registers
-  Wire.beginTransmission(IS31FL3730_DIGIT_6_I2C_ADDRESS);
-  Wire.write(IS31FL3730_Update_Column_Register); // Update Column Register
-  Wire.write(0x00); // Any value should work (value ignored)
-  Wire.endTransmission();
-}
-
-/*
- * Test Routines to force something interesting on the 6-digit display
- */
-void display_update_6b() {
-  Wire.beginTransmission(IS31FL3730_DIGIT_6_I2C_ADDRESS);
-  Wire.write(IS31FL3730_Data_Registers); // Matrix 1 Data Registers 
-  Wire.write(0xFF); // Digit 1 value (far left)
-  Wire.write(0x02); // Digit 2 value
-  Wire.write(0x04); // Digit 3 value
-  Wire.write(0x08); // Digit 4 value
-  Wire.write(0x10); // Digit 5 value
-  Wire.write(0x20); // Digit 6 value (far right)
-  Wire.endTransmission();
-  
-  // Now transfer the data from the temporary registers to the display registers
-  Wire.beginTransmission(IS31FL3730_DIGIT_6_I2C_ADDRESS);
-  Wire.write(IS31FL3730_Update_Column_Register); // Update Column Register
-  Wire.write(0x00); // Any value should work (value ignored)
-  Wire.endTransmission();
-}
-
-/*
- * Arduino Overall Looping Function
- */
-void loop() {
-  // Print "0234" and hold
-  display_update_4a();
-  
-  // Wait and print "12345678"
-  delay(500);
-  setDisplayBrightness(6,0x80);
-  display_update_6a();
-  
-  delay(500);
-  
-  setDisplayBrightness(4,0x10);
-  display_update_4b();
-  
-  delay(500);
-
-  setDisplayBrightness(6,0x02);
-  display_update_6b();
-  
-  delay(500);
-
-  setDisplayBrightness(4,0x80);
-  resetDisplay(4); // reset the 4 digit display
-  
-  delay(500);
-  
-  resetDisplay(6); // reset the 6 digit display
-  
-  delay(500);
-}
+  {
+    // Use the six digit display
+    Wire.beginTransmission(IS31FL3730_DIGIT_6_I2C_ADDRESS);
+  }
+}
+
+/*
+ * Converts characters into the appropriate bytes for display (gfedcba format)
+ */
+byte charToDisplayByte(char displayCharacter)
+{
+  // Although this isn't very time efficient (linear time), it at least saves 
+  // us precious space that a HashMap/Dictionary (constant time) would have 
+  // gobbled up
+  if (displayCharacter == '0') return 0x3F;
+  else if (displayCharacter == '1') return 0x06;
+  else if (displayCharacter == '2') return 0x5B;
+  else if (displayCharacter == '3') return 0x4F;
+  else if (displayCharacter == '4') return 0x66;
+  else if (displayCharacter == '5') return 0x6D;
+  else if (displayCharacter == '6') return 0x7D;
+  else if (displayCharacter == '7') return 0x07;
+  else if (displayCharacter == '8') return 0x7F;
+  else if (displayCharacter == '9') return 0x6F;
+  // The characters are only able to displayed in one case (see left side)
+  // but we should be forgiving and let the user input the wrong case
+  else if ((displayCharacter == 'A') || (displayCharacter == 'a')) return 0x77;
+  else if ((displayCharacter == 'b') || (displayCharacter == 'B')) return 0x7C;
+  else if ((displayCharacter == 'C') || (displayCharacter == 'c')) return 0x39;
+  else if ((displayCharacter == 'd') || (displayCharacter == 'D')) return 0x5E;
+  else if ((displayCharacter == 'E') || (displayCharacter == 'e')) return 0x79;
+  else if ((displayCharacter == 'F') || (displayCharacter == 'f')) return 0x71;
+  // Anythin else turns into a blank for that character
+  else { return NULL; }
+}
+

 */

#include "Wire.h"
#define IS31FL3730_DIGIT_4_I2C_ADDRESS 0x63 // each I2C has a unique bus address, the 4 digit IS31FL3730 display is 0x63
#define IS31FL3730_DIGIT_6_I2C_ADDRESS 0x60 // each I2C has a unique bus address, the 6 digit IS31FL3730 display is 0x60

const byte IS31FL3730_Data_Registers = 0x01; // "Matrix 1 Data Register" index in the IS31FL3730
// 8 bit value to define which segments are lit. 0 == off, 1 == on


/*
 * Resets the display and sets the current to the maximum (5mA per segment)
 *
 * Parameters:
 * digits Selects the display to set the current, 4 = 4 digit display and all
 *        others = 6 digit display
 */
void resetDisplay(int digits)
{
  setupWireTransmission(digits);

  // Reset the lighting effects (dim, bright, etc.)
  // Send any value to reset the lighting (value ignored)
