expression must have class type

30 Aug 2011

Please somebody can tell me what's wrong in this code.

Sorry guys, when I pressed te post button and review the code, I found the problem myself. I used . not ->

the line _phaseZ.fall(this, &PolledQEI::countRev); makes the problem

phaseZ is declared in the protected section of PolledQEI class like that:

InterruptIn *_phaseZ;

void PolledQEI::init(PinName a, PinName b, PinName z){

_phaseA = new DigitalIn( a );

_phaseA->mode( PullUp );

_phaseB = new DigitalIn( b );

_phaseB->mode( PullUp );

_phaseZ = new InterruptIn( z );

_phaseZ->mode( PullUp );

_phaseZ.fall(this, &PolledQEI::countRev);

_actEncPos = 0;

_dir = 0;

_ticker = new Ticker;

}

29 Sep 2011

Hi

try

InterruptIn _phaseZ;

instead of

InterruptIn *_phaseZ;

hope it works..