   }
   Serial.println("Successfully joined TTN");
   okSeq();
-
-}
+}
+
 void okSeq () {
     led_on();
     delay(100);

  digitalWrite(13, 0);
}


    led_off();
}

// the loop routine runs over and over again forever:
void loop()
{
  startTime = millis();
  led_on();
  myLora.autobaud();
  led_off();
  delay(100);
  led_on();
  int16_t temp_c;
  int16_t humidity;
  int16_t battery;

  temp_c = int16_t(sht1x.readTemperatureC()*100);
  humidity = int16_t(sht1x.readHumidity()*100);
  battery = analogRead(batVoltPin)*4.88;


  txBuffer[0] = byte(temp_c>>8);
  txBuffer[1] = byte(temp_c);
  txBuffer[2] = byte(humidity>>8);
  txBuffer[3] = byte(humidity);
  txBuffer[4] = byte(battery>>8);
  txBuffer[5] = byte(battery);
  txBuffer[6] = 0xFE;

  myLora.txBytes(txBuffer, sizeof(txBuffer));
  led_off();

  sleepTime = (SAMPLE_INTERVAL_MS-(millis()-startTime));
  myLora.sleep(sleepTime);
  delay(100);

  go_to_sleep();
}

void led_on()
