Help: attachInterrupt to a function in a class.

	void Engine::Start(){
		attachInterrupt(_rpmpin, RpmTick, RISING);
	}

	void Engine::RpmTick(){
		noInterrupts();
		_rpmTicks++;
		interrupts();
	}
//Error msg: error: argument of type 'void (Engine::)()' does not match 'void (*)()'

Could somebody help me pls. :frowning:
thanks!

You can't do it directly. You need to attach a function (not a method) - in the function, you can call a static method, or a non-static method of a static instance, or of an instance visible to your interrupt handling function by any other means.

PeterH:
You can't do it directly. You need to attach a function (not a method) - in the function, you can call a static method, or a non-static method of a static instance, or of an instance visible to your interrupt handling function by any other means.

Thanks for the reply. Now I know the difference. :slight_smile: