massive Update
This commit is contained in:
30
Software/include/buttoncontrol.h
Normal file
30
Software/include/buttoncontrol.h
Normal file
@@ -0,0 +1,30 @@
|
||||
// === buttoncontrol.h ===
|
||||
#ifndef _BUTTONCONTROL_H_
|
||||
#define _BUTTONCONTROL_H_
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
// Aktionen, die vom Button ausgelöst werden können
|
||||
enum ButtonAction
|
||||
{
|
||||
BTN_NONE,
|
||||
BTN_CUSTOM
|
||||
};
|
||||
|
||||
// Callback-Funktionstyp
|
||||
typedef void (*ButtonCallback)();
|
||||
|
||||
struct ButtonActionEntry
|
||||
{
|
||||
uint32_t holdTimeMs;
|
||||
uint32_t ledColor;
|
||||
ButtonCallback callback;
|
||||
};
|
||||
|
||||
// Initialisierung des Buttonmoduls
|
||||
void ButtonControl_Init(uint8_t pin, const ButtonActionEntry *actions, uint8_t actionCount);
|
||||
|
||||
// Muss regelmäßig in loop() aufgerufen werden
|
||||
void ButtonControl_Update();
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user