コード例 #1
0
bool LightSensor::init()
{
  _tsl = Adafruit_TSL2561_Unified(TSL2561_ADDR_FLOAT, 12345);
  /* Initialise the sensor */
  if (_tsl.begin()) {
    return true;
  } else {
    return false;
  }
  _tsl.enableAutoRange(true);
  _tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_13MS);
}
コード例 #2
0
ファイル: main.cpp プロジェクト: Donny3000/auto-garden
mavlink_soil_volumetric_water_content_t msg_soil_vwc;

//****************************************************************************
//************ Instantiate interfaces for the various pieces of hardware *****
//****************************************************************************
RFM69 radio = RFM69(RFM69_CS, RFM69_IRQ, IS_RFM69HCW, RFM69_IRQN);
DHT_Unified dht(DHTPIN, DHTTYPE);
vegetronix_sensor::Vegetronix_VH400 vh400(A0);
vegetronix_sensor::Vegetronix_THERM200 therm200(A1);
vegetronix_sensor::Vegetronix_VGHUMID vghumid(A2);


// The address will be different depending on whether you leave
// the ADDR pin float (addr 0x39), or tie it to ground or vcc. In those cases
// use TSL2561_ADDR_LOW (0x29) or TSL2561_ADDR_HIGH (0x49) respectively
Adafruit_TSL2561_Unified tsl = Adafruit_TSL2561_Unified(TSL2561_ADDR_FLOAT, 12345);
//****************************************************************************

//****************************************************************************
//**************** Routines to read samples from the sensors *****************
//****************************************************************************

//****************************************************************************
//*************************** ISR for sample timer ***************************
//****************************************************************************
void TC3_Handler()
{
}

//****************************************************************************
//************ Setup Routines for the various pieces of hardware *************