 // DIO1 pin:  3
 // IMPORTANT: because this example uses external interrupts,
 //            DIO0 MUST be connected to Arduino pin 2 or 3.
-//            DIO1 MAY be connected to any free pin 
+//            DIO1 MAY be connected to any free pin
 //            or left floating.
 SX1278 lora = new LoRa;
+
+// save transmission state between loops
+int transmissionState = ERR_NONE;
 
 void setup() {
   Serial.begin(9600);

      int state = lora.transmit(byteArr, 8);
    */

    // NOTE: when using interrupt-driven transmit method,
    //       it is not possible to automatically measure
    //       transmission data rate using getDataRate()
    
    if (state != ERR_NONE) {
      Serial.print(F("failed, code "));
      Serial.println(state);
    }
  }

}

    while (true);
  }

  // set the function that will be called
  // when packet transmission is finished
  lora.setDio0Action(setFlag);

