The MySensor 1.5 code is not compiling for my Arduino Mega 2560 board

  • Contest Winner

    The MySensor 1.5 code is not compiling for my Arduino Mega 2560 board.
    It misses the RF69_IRQ_NUM define in several files.

    In file included from C:\Program Files (x86)\Arduino\libraries\MySensors\MyTransportRFM69.h:26:0,
    from C:\Program Files (x86)\Arduino\libraries\MySensors\MyTransportRFM69.cpp:21:
    C:\Program Files (x86)\Arduino\libraries\MySensors\utility/RFM69.h:78:62: error: 'RF69_IRQ_PIN' was not declared in this scope
    RFM69(byte slaveSelectPin=RF69_SPI_CS, byte interruptPin=RF69_IRQ_PIN, bool isRFM69HW=false, byte interruptNum=RF69_IRQ_NUM) {

    I was able to track the issue down to the RFM69.h file. Line 39 untill 47

    // INT0 on AVRs should be connected to RFM69's DIO0 (ex on Atmega328 it's D2, on Atmega644/1284 it's D2)
    #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega88) || defined(__AVR_ATmega8__) || defined(__AVR_ATmega88__) || defined(__AVR_ATmega32U4__)
      #define RF69_IRQ_PIN          2
      #define RF69_IRQ_NUM          0
    #elif  defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)
      #define RF69_IRQ_PIN          2
      #define RF69_IRQ_NUM          2

    The Ardiuno Mega 2560 seams to not match both if's so no define is declared.

    by replacing this line

    #elif  defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)

    by this line


    Will make the code compile, but does not look like the best solution

Log in to reply

Suggested Topics