test
This commit is contained in:
+21
-6
@@ -3,26 +3,41 @@
|
||||
#include "PCA9685.h"
|
||||
|
||||
class Treppe {
|
||||
private:
|
||||
private:
|
||||
uint8_t stairs;
|
||||
uint16_t time_per_stair = 300; // dimmtime per stair [ms]
|
||||
uint16_t idle_brightness = 200;
|
||||
uint16_t active_brightness = 2048;
|
||||
uint16_t time_per_stair = 100; // dimmtime per stair [ms]
|
||||
uint16_t idle_brightness = 25;
|
||||
uint16_t active_brightness = 500;
|
||||
|
||||
uint8_t direction = 0;
|
||||
uint8_t state = 0;
|
||||
uint8_t switch_state = 0;
|
||||
|
||||
uint32_t tick = 0;
|
||||
uint32_t stufe = 0;
|
||||
|
||||
uint32_t ticks_treppe = 0;
|
||||
uint32_t ticks_pro_stufe = 0;
|
||||
float differenz_pwm_pro_tick = 0.0;
|
||||
|
||||
// initialize with i2c-Address 0, use Wire Library
|
||||
PCA9685 pwmController;
|
||||
uint8_t softstart_led(uint8_t led, uint16_t startval, uint16_t stopval);
|
||||
void ledsequence();
|
||||
|
||||
public:
|
||||
Treppe(uint8_t _stairs) : stairs(_stairs){}
|
||||
public:
|
||||
Treppe(uint8_t _stairs) : stairs(_stairs){
|
||||
ticks_pro_stufe = time_per_stair / 20; // [ms]
|
||||
ticks_treppe = ticks_pro_stufe * stairs;
|
||||
|
||||
differenz_pwm_pro_tick = (active_brightness - idle_brightness)
|
||||
/ ticks_pro_stufe;
|
||||
|
||||
}
|
||||
void task(); // call periodically
|
||||
|
||||
void setup();
|
||||
void elelel();
|
||||
|
||||
// Parameter section
|
||||
uint16_t setIdle(uint16_t _idle_brightness);
|
||||
|
||||
Reference in New Issue
Block a user