Arduino-SerialCommand icon indicating copy to clipboard operation
Arduino-SerialCommand copied to clipboard

Method add commonds doesn't support method of class;

Open osolovyoff opened this issue 9 years ago • 1 comments

I want use like: sc.addCommand(&MPU::start, this); // why not ?

osolovyoff avatar Nov 12 '16 20:11 osolovyoff

This isn't an issue with the library. It's a C/C++ thing. Function pointers to instance methods doesn't really work. There are articles on the web that explain why, but basically calling an instance method is NOT the same as calling a function. If you want this to work then you'll want to use a static method as a static method is called basically the same way as a standard C function.

dwyban avatar Feb 01 '19 01:02 dwyban