   //Bind events for connects and disconnects.
   blePeripheral.setEventHandler(BLEConnected, blePeripheralConnectHandler);
   blePeripheral.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler);
-  
+
   timeCharacteristic.setEventHandler(BLEWritten, setTimeHandler);
-  
+
   //Start BLE service.
   blePeripheral.begin();
 }

  display.setFlip(true);
  display.setBrightness(10);
  display.setBitDepth(buffer.is16bit());
    
  bleSetup();
}

void bleSetup(){
  //Name of BLE peripheral when connecting to master.
  blePeripheral.setLocalName("tinywatch");
  blePeripheral.setAppearance(0xC0);

#include "lib_RenderBuffer.h"
#include "lib_StringBuffer.h"

//Pinouts for TinyShield BLE.
#define BLE_REQ 10
#define BLE_RDY 2
#define BLE_RST 9

const int SCREEN_WIDTH = 48;

//Determines which version of TinyScreen we are using.
TinyScreen display = TinyScreen(TinyScreenPlus);
//Buffer used for drawing.
RenderBuffer<uint16_t, 20> buffer;
int rBackground = 0;
int gBackground = 0;
int bBackground = 0;
char isTimeSet = 0;
//Temp sleep
char isSleep = 0;

//Instantiate BLE peripheral.
BLEPeripheral blePeripheral = BLEPeripheral(BLE_REQ, BLE_RDY, BLE_RST);
