   countdown = 90;
   display.clearWindow(0,0,0,0);
 }
+void startAllProcesses()
+{
+  Wire.begin();
+  display.begin();
+  display.setFlip(1);
+  display.setBrightness(5);
+  Serial.begin(9600);
+  RTC.start();
+}
+}

#define WHITE           0xFF
#define ALPHA           0xFE
#define	BROWN           0x32

  
#include "SSD1331.h"
#include <SPI.h>
#include <Wire.h>
#include "DSRTCLib.h"

#include <avr/power.h>
#include <avr/sleep.h>

int ledPin =  13;
int INT_PIN = 3;
int int_number = 1;
// Defins Pins

DS1339 RTC = DS1339();

int displayState=0;
int buttonReleased=0;
int countdown = 0;
// Defines integers being used

void setup(void) 
{
  startAllProccesses();
  startup();
  display.setCursor(0,30);
}

void loop() 
{
  byte buttons = display.getButtons();
  
  if (buttons != 0)
  {
    displayState = 1;
    display.on();
    countdown = 90;
  	}
    if (buttons == 0) 
    {
      countdown=countdown-1;
    }
  if (countdown<=0)
  {
  display.clearWindow(0,0,0,0);
  displayState = 0;
  display.off();
}
  displayBattery();
  unsigned char second;
  unsigned char minute;
