|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// =============================================== |
|
|
// =============================================== |
|
|
|
|
|
|
|
|
|
|
|
uint8_t inter = 0; |
|
|
|
|
|
ICACHE_RAM_ATTR void int_test(){ |
|
|
|
|
|
inter = 1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void setup() { |
|
|
void setup() { |
|
|
#ifdef WITH_DEBUGGING_ON |
|
|
#ifdef WITH_DEBUGGING_ON |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stairs.setup(); |
|
|
stairs.setup(); |
|
|
Serial.println("PCA9685 connected !"); |
|
|
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_setfn(&timer1, timerCallback, &timer_flag); |
|
|
os_timer_arm(&timer1, 20, true); |
|
|
os_timer_arm(&timer1, 20, true); |
|
|
|
|
|
|
|
|
// stairs.setDirection(!stairs.getDirection()); |
|
|
// stairs.setDirection(!stairs.getDirection()); |
|
|
// stairs.setState(1); |
|
|
// stairs.setState(1); |
|
|
// } |
|
|
// } |
|
|
|
|
|
if(inter){ |
|
|
|
|
|
Serial.printf("interrupt\n"); |
|
|
|
|
|
inter = 0; |
|
|
|
|
|
} |
|
|
if(c++%1000000 == 0) |
|
|
if(c++%1000000 == 0) |
|
|
httpServer.logt("[%d] starting :)\n", c); |
|
|
httpServer.logt("[%d] starting :)\n", c); |
|
|
|
|
|
|