Hi.
I'm making a class for catching simple button inputs on the mbed.
This is my .h:
#ifndef MBED_BTN_H
#define MBED_BTN_H
#include "mbed.h"
class BTN {
public:
BTN(PinName InterruptPort);
private:
InterruptIn _interruptin;
void BTNDOWN(void);
void BTNUP(void);
};
#endif
This is my .cpp
#include "mbed.h"
#include "BTN.h"
BTN::BTN(PinName InterruptPort)
: _interruptin(InterruptPort) {
_interruptin.mode(PullUp);
_interruptin.rise(&BTNDOWN);
_interruptin.fall(&BTNUP);
}
void BTN::BTNDOWN(){
}
void BTN::BTNUP(){
}
I'm getting these errors:
"Nonstandard form for taking the address of a member function (E504-D)" in file "/QUEUE/BTN.cpp"
"No instance of overloaded function "mbed::InterruptIn::rise" matches the argument list (E304)" in file "/QUEUE/BTN.cpp"
" _interruptin.rise(&BTNDOWN); (E0)" in file "/QUEUE/BTN.cpp"
" ^ (E0)" in file "/QUEUE/BTN.cpp"
times two (one for the rise function, and one for the fall.)
Does anybody know what I'm doing wrong?
Hi.
I'm making a class for catching simple button inputs on the mbed.
This is my .h:
This is my .cpp
I'm getting these errors:
"Nonstandard form for taking the address of a member function (E504-D)" in file "/QUEUE/BTN.cpp"
"No instance of overloaded function "mbed::InterruptIn::rise" matches the argument list (E304)" in file "/QUEUE/BTN.cpp"
" _interruptin.rise(&BTNDOWN); (E0)" in file "/QUEUE/BTN.cpp"
" ^ (E0)" in file "/QUEUE/BTN.cpp"
times two (one for the rise function, and one for the fall.)
Does anybody know what I'm doing wrong?