|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "PCA9685.h" |
|
|
#include "PCA9685.h" |
|
|
|
|
|
|
|
|
|
|
|
extern "C" { |
|
|
|
|
|
#include "user_interface.h" |
|
|
|
|
|
} |
|
|
|
|
|
os_timer_t Timer1; // Verwaltungsstruktur des Timers |
|
|
|
|
|
|
|
|
|
|
|
uint32_t c; |
|
|
|
|
|
|
|
|
|
|
|
uint32_t m=0; |
|
|
|
|
|
void timerCallback(void *pArg) |
|
|
|
|
|
{ |
|
|
|
|
|
*((int *) pArg) += 1; |
|
|
|
|
|
|
|
|
|
|
|
Serial.print("hallo\n"); |
|
|
|
|
|
Serial.println(micros()-m); |
|
|
|
|
|
m = micros(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Änderung |
|
|
// Änderung |
|
|
// OTA & WEB |
|
|
// OTA & WEB |
|
|
#include "wifi_credentials.h" |
|
|
#include "wifi_credentials.h" |
|
|
|
|
|
|
|
|
Serial.println(pwmController.getChannelPWM(0)); // Should output 2048, which is 128 << 4 |
|
|
Serial.println(pwmController.getChannelPWM(0)); // Should output 2048, which is 128 << 4 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setup() { |
|
|
void setup() { |
|
|
Serial.begin(115200); |
|
|
Serial.begin(115200); |
|
|
Serial.println(F("Booting ....")); |
|
|
Serial.println(F("Booting ....")); |
|
|
|
|
|
|
|
|
ESP.restart(); |
|
|
ESP.restart(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
os_timer_setfn(&Timer1, timerCallback, &c); |
|
|
|
|
|
os_timer_arm(&Timer1, 1000, true); |
|
|
|
|
|
|
|
|
Serial.println("Ready"); |
|
|
Serial.println("Ready"); |
|
|
Serial.print("IP address: "); |
|
|
Serial.print("IP address: "); |
|
|
Serial.println(WiFi.localIP()); |
|
|
Serial.println(WiFi.localIP()); |
|
|
|
|
|
|
|
|
onoff = 1; |
|
|
onoff = 1; |
|
|
direction = 0; |
|
|
direction = 0; |
|
|
} |
|
|
} |
|
|
TIMEIF_US("OTA", ArduinoOTA.handle(), 20000); |
|
|
|
|
|
TIMEIF_US("HTTP", server.handleClient(), 20000); |
|
|
|
|
|
|
|
|
|
|
|
TIMEIF_US("OTA", ArduinoOTA.handle(), 1000); |
|
|
TIMEIF_US("OTA", ArduinoOTA.handle(), 1000); |
|
|
|
|
|
|
|
|
TIMEIF_US("HTTP", server.handleClient(), 1000); |
|
|
TIMEIF_US("HTTP", server.handleClient(), 1000); |
|
|
|
|
|
|
|
|
} |
|
|
} |