20 lines
275 B
C++
20 lines
275 B
C++
#ifndef Button_h
|
|
#define Button_h
|
|
|
|
#include <Arduino.h>
|
|
|
|
typedef void (*ButtonCallbackFunction)();
|
|
|
|
class Button
|
|
{
|
|
public:
|
|
Button(uint8_t _pin, uint8_t _mode);
|
|
void begin();
|
|
void loop(ButtonCallbackFunction callback);
|
|
|
|
private:
|
|
uint8_t mode;
|
|
uint8_t pin;
|
|
};
|
|
|
|
#endif |