Projet RTE

#include "HDC1000.h"
#include 

Battery battery(3400, 4600, A0, 3);
HDC1000 hdc1000;

void setup() {
  // put your setup code here, to run once:
   Serial.begin(9600);
  // hdc1000.setRdyPin(PIN_NO); // use Rdy Pin
  hdc1000.begin();

  while (!Serial);
  battery.begin();

}

void loop() {
  // put your main code here, to run repeatedly:
  delay(10000);

  //Récupération de la température
  float temp = hdc1000.getTemperature();
  if (temp == HDC1000_ERROR_CODE) {
    hdc1000.begin(); // retry once
    temp = hdc1000.getTemperature();
  }
  
  //Récupération du taux d'humidité
  float humi = hdc1000.getHumidity();
  if (humi== HDC1000_ERROR_CODE) {
    hdc1000.begin(); // retry once
    humi = hdc1000.getTemperature();
  }

  //Affichage des valeurs
  //Température ambiante
  Serial.print("Temperature: ");
  Serial.println(temp);
  
  //Humidité ambiante
  Serial.print("Humidity: ");
  Serial.println(humi);

  //Etat de la batterie
  digitalWrite(13, HIGH);
  digitalWrite(13, LOW);
  Serial.print("Battery voltage is ");
  Serial.print(battery.voltage());
  Serial.print(" (");
  Serial.print("Battery level is ");
  Serial.print(battery.level());
  Serial.println(")");

  Serial.println();
}