     // initialize GPS
     sodaq_gps.init(GPS_ENABLE);
 
+    // Set the datarate/spreading factor at which we communicate.
+    // DR5 is the fastest and best to use. DR0 is the slowest.
+    myLora.setDR(dr);
+
+    // LED pins as outputs. HIGH=Off, LOW=On
     pinMode(LED_BLUE, OUTPUT);
     digitalWrite(LED_BLUE, HIGH);
     pinMode(LED_RED, OUTPUT);

    Serial1.begin(57600);

    // make sure usb serial connection is available,
    // or after 10s go on anyway for 'headless' use of the
    // node.
    while ((!SerialUSB) && (millis() < 10000));

    SerialUSB.println("SODAQ LoRaONE TTN Mapper starting");

  sodaq_gps.scan(true);
  digitalWrite(LED_GREEN, HIGH);

  // if the latitude is 0, we likely do not have a GPS fix yet, so wait longer
  while(sodaq_gps.getLat()==0.0)
  {
    SerialUSB.println("Latitude still 0.0, doing another scan");
