unresolved overloaded function type for Wire.onReceive I am attempting to make an I2C slave out of my Arduino and I can't get past the Wire.onReceive function. Here is my code. The documentation says to just add a function that has the style of void myHandler(int bytes) but I can't figure out why my readPI function does not meet these requirements.

    #include "piCom.h"
    #include "WireAddresses.h"
    #include &lt;Wire.h&gt;

    pi::pi(){
       Wire.begin(NB_INFO); // is 0x04
       Wire.onReceive( readPI );
       //Wire.onRequest(sendPI);
    }

    void pi::readPI(int byteCount){
       while( Wire.available() ){

             ref_IMU = Wire.read();

       }//end while

    }//end readPI

    void pi::sendPI(){

       Wire.write(1);
       //use to send pressure info to pi

    }//end sendPI


    //double pi::getref_IMU(){return ref_IMU;}


then here is the error

piCom.cpp: In constructor 'pi::pi()':
piCom.cpp:7: error: no matching function for call to'TwoWire::onReceive(&lt;unresolved overloaded function type&gt;)'
 Wire.onReceive( readPI );
                        ^

no matching function for call to 'TwoWire::onReceive(&lt;unresolved overloaded function type&gt;)'


Any help is greatly appreciated.
void pi::sendPI(){


That is a class function (method) which has an implicit this pointer. You can't use it as a static ISR.

In general, classes cannot implement ISRs for this reason. There are a few workarounds, one being to make it a static class function. However then it will affect the entire class, not just one instance.