30 lines
559 B
C++
30 lines
559 B
C++
#pragma once
|
|
|
|
#include "PWM_Output.h"
|
|
#include "OneButton.h"
|
|
|
|
enum RAMP_STATE { RampingUp = 0, RampingDown };
|
|
|
|
class RAMP_LIGHT {
|
|
public:
|
|
RAMP_LIGHT(OneButton* button, PWM_Output* pwmOutput, float min, float max, float step);
|
|
|
|
private:
|
|
PWM_Output* pwmOutput;
|
|
OneButton* button;
|
|
float min;
|
|
float max;
|
|
float step;
|
|
float currentValue;
|
|
bool IsOn = false;
|
|
RAMP_STATE rampState;
|
|
int tickCount = 0;
|
|
|
|
void tick();
|
|
void singleClick();
|
|
void longPressStart();
|
|
void longPressStop();
|
|
void duringLongPress();
|
|
};
|
|
|