 
 
 
-static uint8_t mydata[7];
+static uint8_t sensordata[7];
 static osjob_t sendjob;
 
 // Schedule TX every this many seconds (might become longer due to duty

  delay (5000);
  bool status;

  // default settings
  status = bme.begin();
  delay(1000);
  if (!status) {

}

void sensor_data() {

  //Temperatur
  float tempratureReadout = (bme.readTemperature() + 50) * 100; //Temperatur wird um 50°C nach rechts verschoben, dass Temperaturen von -50°C bis +50°C gemessen werden, danach wird mit 100 multipliziert, um Komma zahlen zu vermeiden
  uint16_t temperature = (uint16_t) tempratureReadout; //Temperatur wird gecastet, also von float in ein uint16_t umgewandelt
  uint8_t hightempratureByte = (uint8_t) ((temperature & 0xFF00) >> 8); // bitshift um 8 Stellen nach rechts 
  uint8_t lowtempratureByte = (uint8_t) (temperature & 0xFF); //bitshift um 8 Stellen nach links
  Serial.println(hightempratureByte);
  Serial.println(lowtempratureByte);


  //Luftdruck
  float pressureReadout = bme.readPressure() / 100.0F;
  uint16_t pressure = (uint16_t ) ((pressure / 1013.25) * 100);
  uint8_t pressureByte = (uint8_t) pressure;
  Serial.println(pressureByte); 


  //Luftfeuchtigkeit
  float humidityReadout = bme.readHumidity() * 100;
  uint16_t humidity = (uint16_t) humidityReadout;
  uint8_t highhumidityByte = (uint8_t) ((humidity & 0xFF00) >> 8);
  uint8_t lowhumidityByte = (uint8_t) (humidity & 0xFF);
  Serial.println(highhumidityByte);
  Serial.println(lowhumidityByte); 

  
  //Lichtsensor
  lightsensorValue = analogRead(analogInPin);
  float lightsensorVoltage = (3.3/4096*lightsensorValue);
  float lightsensorStrom = (lightsensorVoltage/10020);
  float lightstrom = (lightsensorStrom*2*1000000);
  lightstrom = lightstrom / 6.5852;         //In Prozent 658,52 (Maximalwert) / 100
  uint8_t lightstromInt = (uint8_t) lightstrom;
  Serial.println(lightstromInt);


  //Bodenfeuchtigkeitssensor
  gndSoilPower = analogRead(gndSoilPin); 
  uint8_t gndPercent = (uint8_t) ((analogRead(A2)/33.30F) * 100); 
  Serial.println(gndPercent);


  //Werte ins Array schreiben
  sensordata[0] = hightempratureByte;
  sensordata[1] = lowtempratureByte;
  sensordata[2] = pressureByte;
  sensordata[3] = highhumidityByte;
  sensordata[4] = lowhumidityByte;
  sensordata[5] = lightstromInt;
  sensordata[6] = gndPercent;

  
}
