 /////////////////////////////////////////////////////////////////////////////
 // sensor/actuator stuff ////////////////////////////////////////////////////
 void startPeripherals() {
-  mySwitch.enableTransmit(13);   // RC Transmitter is connected to Pin #13  
+  mySwitch.enableTransmit(13);   // RC Transmitter is connected to Pin #13
+  
   tempSensor.begin();     // Start the onewire temperature sensor
   tempSensor.getAddress(tempAddr, 0);
   tempSensor.setResolution(tempAddr, 12);    // set the resolution to 12 bit (DS18B20 goes from 9-12 bit)
+  
+  dht.begin();    // Start the humidity and air temperature sensor
+
+  // You can change the gain of the light sensor on the fly, to adapt to brighter/dimmer light situations
+  //tsl.setGain(TSL2591_GAIN_LOW);    // 1x gain (bright light)
+  tsl.setGain(TSL2591_GAIN_MED);      // 25x gain
+  //tsl.setGain(TSL2591_GAIN_HIGH);   // 428x gain
+  
+  // Changing the integration time gives you a longer time over which to sense light
+  // longer timelines are slower, but are good in very low light situtations!
+  //tsl.setTiming(TSL2591_INTEGRATIONTIME_100MS);  // shortest integration time (bright light)
+  //tsl.setTiming(TSL2591_INTEGRATIONTIME_200MS);
+  tsl.setTiming(TSL2591_INTEGRATIONTIME_300MS);
+  //tsl.setTiming(TSL2591_INTEGRATIONTIME_400MS);
+  //tsl.setTiming(TSL2591_INTEGRATIONTIME_500MS);
+  //tsl.setTiming(TSL2591_INTEGRATIONTIME_600MS);  // longest integration time (dim light)
+
+  tsl.begin();    // Start the light sensor
 }
 
 void updateSensorData(monitor_t *monitorData) {

#include <DNSServer.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <RCSwitch.h>

/////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////
// temperature sensor stuff /////////////////////////////////////////////////
OneWire ds(2); // DS1820 on pin 2 (a 4.7K resistor is necessary)
DallasTemperature tempSensor(&ds);  // pass through reference to library
//void getTemperature(float* waterCelsius);
const boolean GOT_TEMP_SENSOR = true;
// array to hold device address
DeviceAddress tempAddr;

/////////////////////////////////////////////////////////////////////////////
// humidity sensor stuff ////////////////////////////////////////////////////
DHT dht(12, DHT22); // what digital pin we're connected to, plus type DHT22 aka AM2302
const boolean GOT_HUMID_SENSOR = true;

/////////////////////////////////////////////////////////////////////////////
// Light sensor stuff ///////////////////////////////////////////////////////
Adafruit_TSL2591 tsl = Adafruit_TSL2591(2591); // pass in a number for the sensor identifier (for your use later)
const boolean GOT_LIGHT_SENSOR = true;

/////////////////////////////////////////////////////////////////////////////
// RC switch stuff //////////////////////////////////////////////////////////
RCSwitch mySwitch = RCSwitch();
