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 a46dc12..653d882 100644 --- a/lib/treppe/treppe.cpp +++ b/lib/treppe/treppe.cpp @@ -198,7 +198,7 @@ void Treppe::task(){ last_sensor_state[1] = current_sensor_state[1]; ledsequence(); - + //Serial.printf("LDR: %f\n", ((float)analogRead(A0))/1023.*3.68); } diff --git a/src/main.cpp b/src/main.cpp index f00950e..808cfe4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -42,7 +42,10 @@ void timerCallback(void *pArg) } // =============================================== - +uint8_t inter = 0; +ICACHE_RAM_ATTR void int_test(){ + inter = 1; +} void setup() { #ifdef WITH_DEBUGGING_ON @@ -84,6 +87,8 @@ void setup() { stairs.setup(); Serial.println("PCA9685 connected !"); + //attachInterrupt(digitalPinToInterrupt(2), int_test, RISING); + //attachInterrupt(digitalPinToInterrupt(12), int_test, RISING); os_timer_setfn(&timer1, timerCallback, &timer_flag); os_timer_arm(&timer1, 20, true); @@ -106,6 +111,10 @@ void loop() { // stairs.setDirection(!stairs.getDirection()); // stairs.setState(1); // } + if(inter){ + Serial.printf("interrupt\n"); + inter = 0; + } if(c++%1000000 == 0) httpServer.logt("[%d] starting :)\n", c);