 int readLightConverter(){
   return analogRead(DETECTORPIN);
 }
+void latchControl(int level){
+  mcp.digitalWrite(LATCHPIN, level);
+}
 Photometer photometer(blueLEDControl, greenLEDControl, readLightConverter);
 
 void setupPhotometer(){
   mcp.begin();
+  mcp.pinMode(LATCHPIN, OUTPUT);
+  mcp.digitalWrite(LATCHPIN, HIGH);
   mcp.pinMode(BLUELEDPIN, OUTPUT);
   mcp.digitalWrite(BLUELEDPIN, LOW);
   mcp.pinMode(GREENLEDPIN, OUTPUT);

// pH Photometer

#include "Photometer.h"

#include <SPI.h>
#include <Wire.h>
#include "utilities.h"
#include <RFduinoBLE.h>
#include "BTLE.h"

#define BLUELEDPIN 7
#define GREENLEDPIN 0
#define DETECTORPIN 6
#define LATCHPIN 3
#define IDLETIME 600000      // This indicages 600 secs * 1000 ms for an idle time reset

#define DEBUG
unsigned long latchtime;

// I2C Wire Setup
#define SCLPIN 3
