   delay(1000);
   #endif
 
-  #ifdef LED_RED
-  pinMode(LED_RED, OUTPUT);
-  pinMode(LED_GREEN, OUTPUT);
-  pinMode(LED_BLUE, OUTPUT);
-  digitalWrite(LED_RED, LOW);
-  digitalWrite(LED_GREEN, HIGH);
-  digitalWrite(LED_BLUE, HIGH);
-  #else
   pinMode(LED_BUILTIN, OUTPUT);
-  #endif
 
   // initialize runtime env
   os_init();
 
   // Set up these settings once, and use them for both TX and RX
 
-  // Use the ping settings. In 868Mhz, this is F6 frequency which allows
-  // 10% duty cycle and the most tx power (27dBm). In 868 this is
-  // channel 0, which allows up to 30dBm.
-  LMIC.datarate = DR_PING;
-  LMIC.freq = FREQ_PING;
+  // Use a frequency in the g3 which allows 10% duty cycling.
+  LMIC.freq = 869525000;
+  // Maximum TX power
   LMIC.txpow = 27;
+  // Use a medium spread factor. This can be increased up to SF12 for
+  // better range, but then the interval should be (significantly)
+  // lowered to comply with duty cycle limits as well.
+  LMIC.datarate = DR_SF9;
+  // This sets CR 4/5, BW125 (except for DR_SF7B, which uses BW250)
   LMIC.rps = updr2rps(LMIC.datarate);
 
   Serial.println("Started");

       config.h in the lmic library to set it.
#endif

const lmic_pinmap lmic_pins = {
  .nss = SS,
  .rxtx = 8, // Not connected
  .rst = A7, // Not connected
  .dio = {4, 5, 7},
};

//LMIC application callbacks not used in his example

 * This example transmits data on hardcoded channel and receives data
 * when not transmitting. Running this sketch on two nodes should allow
 * them to communicate.
 *******************************************************************************/

#include <lmic.h>
