   digitalWriteFast(batteryLed, LOW);
   
   // Define/set debounce intervalls here to suit your buttons
-  
+  // Remember to adjust the amount of these if you have
+  // more or less buttons.
   debouncer3.attach(3);  debouncer3.interval(5);
   debouncer4.attach(4);  debouncer4.interval(5);
   debouncer5.attach(5);  debouncer5.interval(5);

  analogReadRes(12);
  analogReadAveraging(5);
  analogReference(INTERNAL);
}

void updateButtons() {
  debouncer3.update();
  if(debouncer3.fell()) {
    buttons_0_6 |= 0b00000001;
    Serial1.write(buttons_0_6);
  } else if(debouncer3.rose()) {
    buttons_0_6 &= ~(0b00000001);
    Serial1.write(buttons_0_6);
  }
  
  debouncer4.update();
  if(debouncer4.fell()) {
    buttons_0_6 |= 0b00000010;
    Serial1.write(buttons_0_6);
  } else if(debouncer4.rose()) {
    buttons_0_6 &= ~(0b00000010);
    Serial1.write(buttons_0_6);
  }
  
  debouncer5.update();
  if(debouncer5.fell()) {
    buttons_0_6 |= 0b00000100;
    Serial1.write(buttons_0_6);
  } else if(debouncer5.rose()) {
    buttons_0_6 &= ~(0b00000100);
    Serial1.write(buttons_0_6);
  }

  debouncer6.update();
  if(debouncer6.fell()) {
    buttons_0_6 |= 0b00001000;
    Serial1.write(buttons_0_6);
  } else if(debouncer6.rose()) {
    buttons_0_6 &= ~(0b00001000);
    Serial1.write(buttons_0_6);
  }

  debouncer7.update();
  if(debouncer7.fell()) {
    buttons_0_6 |= 0b00010000;
    Serial1.write(buttons_0_6);
  } else if(debouncer7.rose()) {
    buttons_0_6 &= ~(0b00010000);
    Serial1.write(buttons_0_6);
  }

  debouncer8.update();
  if(debouncer8.fell()) {
    buttons_0_6 |= 0b00100000;
    Serial1.write(buttons_0_6);
  } else if(debouncer8.rose()) {
    buttons_0_6 &= ~(0b00100000);
    Serial1.write(buttons_0_6);
  }

  debouncer9.update();
  if(debouncer9.fell()) {
    buttons_0_6 |= 0b01000000;
    Serial1.write(buttons_0_6);
  } else if(debouncer9.rose()) {
    buttons_0_6 &= ~(0b01000000);
    Serial1.write(buttons_0_6);
  }

  debouncer10.update();
  if(debouncer10.fell()) {
    buttons_7_13 |= 0b00000001;
    Serial1.write(buttons_7_13);
  } else if(debouncer10.rose()) {
    buttons_7_13 &= ~(0b00000001);
    Serial1.write(buttons_7_13);
  }

  debouncer11.update();
  if(debouncer11.fell()) {
    buttons_7_13 |= 0b00000010;
    Serial1.write(buttons_7_13);
  } else if(debouncer11.rose()) {
    buttons_7_13 &= ~(0b00000010);
    Serial1.write(buttons_7_13);
  }

  debouncer12.update();
  if(debouncer12.fell()) {
    buttons_7_13 |= 0b00000100;
    Serial1.write(buttons_7_13);
  } else if(debouncer12.rose()) {
    buttons_7_13 &= ~(0b00000100);
    Serial1.write(buttons_7_13);
  }
}


#define batteryADC 23 


// Uncomment this to save a bit of battery power.
// DANGER: Please make double sure that all your unconnected pins
// are correctly set in InitialiseIO() -function.
// Errors here will permanently damage your Teensy microcontroller.

// #define POWERSAVING_WITH_PINS_AS_OUTPUTS



// Included the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
// The library has been modified to use digitalReadFast().
// Fast reactions are needed in the buttons. Therefore in the library,
// this is defined:
//  By defining "#define BOUNCE_LOCK_OUT" in "Bounce.h" 
//  you can activate the alternative debouncing method. This method is 
//  a lot more responsive, but does not cancel noise.
#include "Bounce2.h"


// Bouncer instances connected to buttons.
// If you have more or less buttons,
// adjust this to your liking.
Bounce debouncer3 = Bounce(); 
Bounce debouncer4 = Bounce(); 
Bounce debouncer5 = Bounce(); 
