  */
 void poll_button_task()
 {
-  if(digitalRead(BUTTON_PIN) == LOW)
+  if(digitalRead(IO::TIME_RESET) == LOW)
     {
       //Reset counter and clear the display.
       counter.setTime(0, 0, 0);
       clearDisplay();
 
-      digitalWrite(BUTTON_LED, HIGH);
+      digitalWrite(IO::TIME_RESET_LED, HIGH);
     }
   else
     {
-      digitalWrite(BUTTON_LED, LOW);
+      digitalWrite(IO::TIME_RESET_LED, LOW);
     }
 }
 


void setup() {
  //Initilise pins
  pinMode(BUTTON_LED, OUTPUT);
  pinMode(TIME_LED, OUTPUT);
  pinMode(BUTTON_PIN, INPUT);

  pinMode(INPUT1_PIN, OUTPUT);
  pinMode(INPUT2_PIN, OUTPUT);
  pinMode(INPUT4_PIN, OUTPUT);
  pinMode(INPUT8_PIN, OUTPUT);
  pinMode(DP_PIN, OUTPUT);

  pinMode(ENABLE1_PIN, OUTPUT);
  pinMode(ENABLE2_PIN, OUTPUT);
  pinMode(ENABLE3_PIN, OUTPUT);
  pinMode(ENABLE4_PIN, OUTPUT);
  pinMode(ENABLE5_PIN, OUTPUT);

  //Initilise display
  uint8_t enable_pins[5] =  {ENABLE1_PIN, ENABLE2_PIN, ENABLE3_PIN, ENABLE4_PIN, ENABLE5_PIN};
  
  display = new HPNumberDisplay(5, enable_pins,
			  INPUT1_PIN, INPUT2_PIN, INPUT4_PIN, INPUT8_PIN, DP_PIN);
  
  scheduler.createSchedule(1000, -1, true, second_count_task);
  scheduler.createSchedule(100, -1, true, poll_button_task);


#include <TimeCounter.h>

//Pin definitions
namespace IO
{
  enum OutPins
    {
      TIME_RESET_LED = 13,
      TIME_LED       = 8,
      
      INPUT1         = 14,
      INPUT2         = 15,
      INPUT4         = 16,
      INPUT8         = 17,
      DP             = 18,

      ENABLE1        = 7,
      ENABLE2        = 9,
      ENABLE3        = 10,
      ENABLE4        = 19,
      ENABLE5        = 5,
    };

  enum InPins
    {
      TIME_RESET = 6
    };
  
  const uint8_t enable_pins[5] = {ENABLE1, ENABLE2, ENABLE3, ENABLE4, ENABLE5};
}

Scheduler scheduler;
TimeCounter counter;
HPNumberDisplay display(5, IO::enable_pins, IO::INPUT1, IO::INPUT2, IO::INPUT4, IO::INPUT8, IO::DP);

/*
  Returns the nth digit in a number
