diff --git a/lib/PCA9685-Arduino b/lib/PCA9685-Arduino index a70be39..23e06c0 160000 --- a/lib/PCA9685-Arduino +++ b/lib/PCA9685-Arduino @@ -1 +1 @@ -Subproject commit a70be39257e317d35e9118b385006a1e030e6452 +Subproject commit 23e06c06a6026801a856141f64a6de54dd493b47 diff --git a/lib/treppe/treppe.cpp b/lib/treppe/treppe.cpp index 8aa7466..a46dc12 100644 --- a/lib/treppe/treppe.cpp +++ b/lib/treppe/treppe.cpp @@ -140,9 +140,11 @@ void Treppe::setup(){ // https://github.com/NachtRaveVL/PCA9685-Arduino/issues/15 // see also lib/PCA9685-Arduin/PCA9685.h:204 pwmController.init(PCA9685_PhaseBalancer_None); - pwmController.setPWMFrequency(200); + //pwmController.init(PCA9685_PhaseBalancer_Linear); + pwmController.setPWMFrequency(100); pwmController.setAllChannelsPWM(idle_brightness); - + + pinMode(A0, INPUT); pinMode(SENSOR1, INPUT); pinMode(SENSOR2, INPUT); pinMode(OE, OUTPUT); @@ -196,6 +198,7 @@ void Treppe::task(){ last_sensor_state[1] = current_sensor_state[1]; ledsequence(); + } diff --git a/lib/treppe/treppe.h b/lib/treppe/treppe.h index 804d525..64fee9c 100644 --- a/lib/treppe/treppe.h +++ b/lib/treppe/treppe.h @@ -2,7 +2,7 @@ #include "PCA9685.h" -#define SENSOR1 16 +#define SENSOR1 2 #define SENSOR2 12 #define OE 14 @@ -12,8 +12,8 @@ class Treppe { private: uint8_t stairs; uint16_t time_per_stair = 300; // dimmtime per stair [ms] - uint16_t idle_brightness = 0; - uint16_t active_brightness = 500; + uint16_t idle_brightness = 100; + uint16_t active_brightness = 2048; uint8_t direction = 0; uint8_t switch_direction = 0;