 float altitude = -1;
 int pressure = -1;
 uint16_t light = 0;
+uint16_t uvLight = 0;
 
 short loopCnt = 0;
 // timing


void readSensor(){
    //Serial.println("Read bpm180");
    sensors_event_t event;
    bmp.getEvent(&event);

    // Do we have datas
    if (event.pressure) {
      float myTemperature;
      bmp.getTemperature(&myTemperature);
      if(myTemperature<150){
        // assumed correct read
        temperature = myTemperature;
        pressure = event.pressure;
        altitude = bmp.pressureToAltitude(
          SENSORS_PRESSURE_SEALEVELHPA,
          event.pressure
        );
      }
    }
    //Serial.println("Read bh1750");
    uint16_t myLight = readLight();
    if(myLight>=0){
      // assumed correct read
      light = myLight;
    }
}
/**************************************************************************/
/*

  return val;
}

uint16_t readUvLight(){
  return uv.readUV();
}

void trace(){
    // DISPLAY DATA
    if(loopCnt++ %20 == 0){
      printHeader();
    }
    printData(temperature, pressure, altitude, light, uvLight);
}

void printData(float aTemperature, int aPressure, float aAltitude, uint16_t aLight, uint16_t aUvLight){
  Serial.print(aTemperature);
  Serial.print("\t");
  Serial.print(aPressure);
  Serial.print("\t");
  Serial.print(aAltitude);
  Serial.print("\t");
  Serial.print(aLight);
  Serial.print("\t");
  Serial.println(aUvLight);
}

void printHeader(){
  Serial.println("Temperature °C\tPressure\tAltitude\tlight\tUV");
}


