-
+#include <Wire.h>
+#include <Adafruit_Sensor.h>
+#include <Adafruit_TSL2561.h>
 
 class TMP36
 {

    cd5PhotoCell->takeReading();
    cd5PhotoCell->toSerial();

    Serial.println();

    delay(5000);

    }
};

class TSL2561
{
    void initialize(uint8_t address, int32_t id)
    {
        i2cAddress = address;
        sensorId = id;
        tsl = new Adafruit_TSL2561(address, id);

        /* You can also manually set the gain or enable auto-gain support */
        // tsl->setGain(TSL2561_GAIN_1X);      /* No gain ... use in bright light to avoid sensor saturation */
        // tsl->setGain(TSL2561_GAIN_16X);     /* 16x gain ... use in low light to boost sensitivity */
        tsl->enableAutoGain(true);          /* Auto-gain ... switches automatically between 1x and 16x */

        /* Changing the integration time gives you better sensor resolution (402ms = 16-bit data) */
        tsl->setIntegrationTime(TSL2561_INTEGRATIONTIME_13MS);      /* fast but low resolution */
//        tsl->setIntegrationTime(TSL2561_INTEGRATIONTIME_101MS);  /* medium resolution and speed   */
//        tsl->setIntegrationTime(TSL2561_INTEGRATIONTIME_402MS);  /* 16-bit data but slowest conversions */

        initialized = false;
        if(tsl->begin())
        {
            initialized = true;
        }
    }

    void getLuminosity()
    {
        broadband = 0;
        infrared = 0;

        tsl->getLuminosity(&broadband, &infrared);
    }

    public:
    uint8_t i2cAddress;
    int32_t sensorId;

    Adafruit_TSL2561 * tsl;
    bool initialized;
    sensors_event_t event;

    uint16_t broadband;
    uint16_t infrared;

    TSL2561(uint8_t address, int32_t id)
    {
        initialize(address, id);
    }

    TSL2561(uint8_t address)
    {
        initialize(address, 2112);
    }

    TSL2561()
    {
        initialize(TSL2561_ADDR_FLOAT, 2112);
    }

    bool takeReading()
    {
        if(!initialized) { return false; }
        tsl->getEvent(&event);
    }

    int getLux()
    {
        return event.light;
    }

    int getInfrared()
    {
        getLuminosity();
        return infrared;
    }

    int getBroadband()
    {
        getLuminosity();
        return broadband;
    }

    void toSerial()
    {
        Serial.print("TSL2561--Lux: ");
        Serial.print(getLux());
        Serial.print(", Broadband: ");
        Serial.print(getBroadband());
        Serial.print(", Infrared: ");
        Serial.print(getInfrared());
        Serial.println(".");
    }
};

TMP36 * tmp36;
Cd5PhotoCell * cd5PhotoCell;
TSL2561 * tsl2561;

void setup()
{
    Serial.begin(57600);

    cd5PhotoCell = new Cd5PhotoCell(0);
    tmp36 = new TMP36(1, 5.0, 100);
    tsl2561 = new TSL2561();
}

void loop()
