diff --git a/WeTimer/WeTimer.h b/WeTimer/WeTimer.h index d0815d0..a716568 100644 --- a/WeTimer/WeTimer.h +++ b/WeTimer/WeTimer.h @@ -43,8 +43,8 @@ #define ORG_NAME "fra589" #define APP_NAME "WeTimer\0" - #define APP_VERSION_STRING "v0.9.6" - #define APP_VERSION_DATE "20230128" + #define APP_VERSION_STRING "v0.9.7" + #define APP_VERSION_DATE "20230325" //---------------------------------------------------------------------------------------------------- @@ -52,34 +52,36 @@ //---------------------------------------------------------------------------------------------------- #define EEPROM_LENGTH 512 //---------------------------------------------------------------------------------------------------- - #define ADDR_TEMPS_ARMEMENT 0 - #define ADDR_TEMPS_VOL 2 - #define ADDR_SERVO_STAB_VOL 4 - #define ADDR_SERVO_STAB_TREUIL 6 - #define ADDR_SERVO_STAB_DT 8 - #define ADDR_SERVO_DERIVE_VOL 10 - #define ADDR_SERVO_DERIVE_TREUIL 12 - #define ADDR_SERVO_DERIVE_ZOOM 14 - #define ADDR_CLI_SSID 16 - #define ADDR_CLI_PWD 48 // 16 + 32 - #define ADDR_AP_SSID 111 // 48 + 63 - #define ADDR_AP_PWD 143 // 111 + 32 + #define ADDR_TEMPS_ARMEMENT 0 + #define ADDR_TEMPS_VOL 2 + #define ADDR_SERVO_STAB_VOL 4 + #define ADDR_SERVO_STAB_TREUIL 6 + #define ADDR_SERVO_STAB_DT 8 + #define ADDR_SERVO_DERIVE_VOL 10 + #define ADDR_SERVO_DERIVE_TREUIL_TENDU 12 + #define ADDR_SERVO_DERIVE_TREUIL_VIRAGE 14 + #define ADDR_SERVO_DERIVE_ZOOM 16 + #define ADDR_CLI_SSID 18 + #define ADDR_CLI_PWD 50 // 18 + 32 + #define ADDR_AP_SSID 113 // 50 + 63 + #define ADDR_AP_PWD 145 // 113 + 32 //---------------------------------------------------------------------------------------------------- // Valeurs des paramètres par défauts //---------------------------------------------------------------------------------------------------- - #define DEFAULT_TEMPS_ARMEMENT 2 // Délai d'armement de la minuterie = 2 seconde - #define DEFAULT_TEMPS_VOL 183 // Temps de vol par défaut 3 minutes - #define DEFAULT_SERVO_STAB_VOL 1000 // Position servo au départ du vol (1000 micro secondes = 0°) - #define DEFAULT_SERVO_STAB_TREUIL 1200 // Position servo quand le switch crochet est actionné (câble tendu) - #define DEFAULT_SERVO_STAB_DT 2000 // Position servo au DT (2000 micro secondes = angle max du servo) - #define DEFAULT_SERVO_DERIVE_VOL 1100 // Position servo de dérive en vol spirale - #define DEFAULT_SERVO_DERIVE_TREUIL 1500 // Position servo de dérive câble tendu (montée droite) - #define DEFAULT_SERVO_DERIVE_ZOOM 1300 // Position servo de dérive câble tendu au zoom - #define DEFAULT_CLI_SSID "\0" // SSID client (la minuterie se connecte si défini) - #define DEFAULT_CLI_PWD "\0" // WPA-PSK/WPA2-PSK client - #define DEFAULT_AP_SSID "WeTimer_\0" // SSID de l'AP minuterie - #define DEFAULT_AP_PWD "\0" // WPA-PSK/WPA2-PSK AP + #define DEFAULT_TEMPS_ARMEMENT 2 // Délai d'armement de la minuterie = 2 seconde + #define DEFAULT_TEMPS_VOL 183 // Temps de vol par défaut 3 minutes + #define DEFAULT_SERVO_STAB_VOL 1000 // Position servo au départ du vol (1000 micro secondes = 0°) + #define DEFAULT_SERVO_STAB_TREUIL 1200 // Position servo quand le switch crochet est actionné (câble tendu) + #define DEFAULT_SERVO_STAB_DT 2000 // Position servo au DT (2000 micro secondes = angle max du servo) + #define DEFAULT_SERVO_DERIVE_VOL 1200 // Position servo de dérive en vol spirale + #define DEFAULT_SERVO_DERIVE_TREUIL_TENDU 1500 // Position servo de dérive câble tendu (montée droite) + #define DEFAULT_SERVO_DERIVE_TREUIL_VIRAGE 1100 // Position servo de dérive câble détendu (virage treuil) + #define DEFAULT_SERVO_DERIVE_ZOOM 1300 // Position servo de dérive câble tendu au zoom + #define DEFAULT_CLI_SSID "\0" // SSID client (la minuterie se connecte si défini) + #define DEFAULT_CLI_PWD "\0" // WPA-PSK/WPA2-PSK client + #define DEFAULT_AP_SSID "WeTimer_\0" // SSID de l'AP minuterie + #define DEFAULT_AP_PWD "\0" // WPA-PSK/WPA2-PSK AP #define MIN_SERVO_MICROSECONDS 1000 #define MAX_SERVO_MICROSECONDS 2000 @@ -95,13 +97,13 @@ //---------------------------------------------------------------------------------------------------- // Valeurs d'état du switch crochet //---------------------------------------------------------------------------------------------------- - #define CROCHET_TENDU 0 + #define CROCHET_TENDU 0 #define CROCHET_RELACHE 1 //---------------------------------------------------------------------------------------------------- // Valeurs d'état du switch zoom //---------------------------------------------------------------------------------------------------- - #define ZOOM_ON 0 + #define ZOOM_ON 0 #define ZOOM_OFF 1 //---------------------------------------------------------------------------------------------------- @@ -130,10 +132,11 @@ extern unsigned int servoStabTreuil; extern unsigned int servoStabDT; extern unsigned int servoDeriveVol; - extern unsigned int servoDeriveTreuil; + extern unsigned int servoDeriveTreuilTendu; + extern unsigned int servoDeriveTreuilVirage; extern unsigned int servoDeriveZoom; - // hostname for mDNS. Should work at least on windows. Try http://minuterie.local + // hostname for mDNS. Should work at least on windows. Try http://WeTimer.local extern const char *myHostname; // DNS server diff --git a/WeTimer/WeTimer.ino b/WeTimer/WeTimer.ino index c468fc3..4871da2 100644 --- a/WeTimer/WeTimer.ino +++ b/WeTimer/WeTimer.ino @@ -30,14 +30,15 @@ char cli_pwd[63] = DEFAULT_CLI_PWD; char ap_ssid[32] = DEFAULT_AP_SSID; char ap_pwd[63] = DEFAULT_AP_PWD; -unsigned int delaiArmement = DEFAULT_TEMPS_ARMEMENT; // Secondes -unsigned int tempsVol = DEFAULT_TEMPS_VOL; // Secondes -unsigned int servoStabVol = DEFAULT_SERVO_STAB_VOL; // Microsecondes -unsigned int servoStabTreuil = DEFAULT_SERVO_STAB_TREUIL; // Microsecondes -unsigned int servoStabDT = DEFAULT_SERVO_STAB_DT; // Microsecondes -unsigned int servoDeriveVol = DEFAULT_SERVO_DERIVE_VOL; // Microsecondes -unsigned int servoDeriveTreuil = DEFAULT_SERVO_DERIVE_TREUIL; // Microsecondes -unsigned int servoDeriveZoom = DEFAULT_SERVO_DERIVE_ZOOM; // Microsecondes +unsigned int delaiArmement = DEFAULT_TEMPS_ARMEMENT; // Secondes +unsigned int tempsVol = DEFAULT_TEMPS_VOL; // Secondes +unsigned int servoStabVol = DEFAULT_SERVO_STAB_VOL; // Microsecondes +unsigned int servoStabTreuil = DEFAULT_SERVO_STAB_TREUIL; // Microsecondes +unsigned int servoStabDT = DEFAULT_SERVO_STAB_DT; // Microsecondes +unsigned int servoDeriveVol = DEFAULT_SERVO_DERIVE_VOL; // Microsecondes +unsigned int servoDeriveTreuilTendu = DEFAULT_SERVO_DERIVE_TREUIL_TENDU; // Microsecondes +unsigned int servoDeriveTreuilVirage = DEFAULT_SERVO_DERIVE_TREUIL_VIRAGE; // Microsecondes +unsigned int servoDeriveZoom = DEFAULT_SERVO_DERIVE_ZOOM; // Microsecondes /* hostname for mDNS. Should work at least on windows. Try http://minuterie.local */ const char *myHostname = APP_NAME; @@ -60,7 +61,8 @@ int zoom = 0; Servo servoStab; // Variable globale servo stabilisateur Servo servoDerive; // Servo pour la dérive -int timerStatus = STATUS_DT; +int timerStatus = STATUS_DT; +bool flagZoom = false; unsigned long blinkInterval = 1000; // 1 secondes unsigned long previousBlink = 0; @@ -83,14 +85,15 @@ void setup() { EEPROM.begin(EEPROM_LENGTH); // Récupération des paramètres dans la Flash ou de leur valeur par défaut - delaiArmement = EEPROM_readInt(ADDR_TEMPS_ARMEMENT); if (delaiArmement == 0xFFFF) delaiArmement = DEFAULT_TEMPS_ARMEMENT; - tempsVol = EEPROM_readInt(ADDR_TEMPS_VOL); if (tempsVol == 0xFFFF) tempsVol = DEFAULT_TEMPS_VOL; - servoStabVol = EEPROM_readInt(ADDR_SERVO_STAB_VOL); if (servoStabVol == 0xFFFF) servoStabVol = DEFAULT_SERVO_STAB_VOL; - servoStabTreuil = EEPROM_readInt(ADDR_SERVO_STAB_TREUIL); if (servoStabTreuil == 0xFFFF) servoStabTreuil = DEFAULT_SERVO_STAB_TREUIL; - servoStabDT = EEPROM_readInt(ADDR_SERVO_STAB_DT); if (servoStabDT == 0xFFFF) servoStabDT = DEFAULT_SERVO_STAB_DT; - servoDeriveVol = EEPROM_readInt(ADDR_SERVO_DERIVE_VOL); if (servoDeriveVol == 0xFFFF) servoDeriveVol = DEFAULT_SERVO_DERIVE_VOL; - servoDeriveTreuil = EEPROM_readInt(ADDR_SERVO_DERIVE_TREUIL); if (servoDeriveTreuil == 0xFFFF) servoDeriveTreuil = DEFAULT_SERVO_DERIVE_TREUIL; - servoDeriveZoom = EEPROM_readInt(ADDR_SERVO_DERIVE_ZOOM); if (servoDeriveZoom == 0xFFFF) servoDeriveZoom = DEFAULT_SERVO_DERIVE_ZOOM; + delaiArmement = EEPROM_readInt(ADDR_TEMPS_ARMEMENT); if (delaiArmement == 0xFFFF) delaiArmement = DEFAULT_TEMPS_ARMEMENT; + tempsVol = EEPROM_readInt(ADDR_TEMPS_VOL); if (tempsVol == 0xFFFF) tempsVol = DEFAULT_TEMPS_VOL; + servoStabVol = EEPROM_readInt(ADDR_SERVO_STAB_VOL); if (servoStabVol == 0xFFFF) servoStabVol = DEFAULT_SERVO_STAB_VOL; + servoStabTreuil = EEPROM_readInt(ADDR_SERVO_STAB_TREUIL); if (servoStabTreuil == 0xFFFF) servoStabTreuil = DEFAULT_SERVO_STAB_TREUIL; + servoStabDT = EEPROM_readInt(ADDR_SERVO_STAB_DT); if (servoStabDT == 0xFFFF) servoStabDT = DEFAULT_SERVO_STAB_DT; + servoDeriveVol = EEPROM_readInt(ADDR_SERVO_DERIVE_VOL); if (servoDeriveVol == 0xFFFF) servoDeriveVol = DEFAULT_SERVO_DERIVE_VOL; + servoDeriveTreuilTendu = EEPROM_readInt(ADDR_SERVO_DERIVE_TREUIL_TENDU); if (servoDeriveTreuilTendu == 0xFFFF) servoDeriveTreuilTendu = DEFAULT_SERVO_DERIVE_TREUIL_TENDU; + servoDeriveTreuilVirage = EEPROM_readInt(ADDR_SERVO_DERIVE_TREUIL_VIRAGE); if (servoDeriveTreuilVirage == 0xFFFF) servoDeriveTreuilVirage = DEFAULT_SERVO_DERIVE_TREUIL_VIRAGE; + servoDeriveZoom = EEPROM_readInt(ADDR_SERVO_DERIVE_ZOOM); if (servoDeriveZoom == 0xFFFF) servoDeriveZoom = DEFAULT_SERVO_DERIVE_ZOOM; char charTmp = char(EEPROM.read(ADDR_CLI_SSID)); if (charTmp != 0xFF) { @@ -125,36 +128,38 @@ void setup() { } #ifdef debug - Serial.print("delaiArmement = "); Serial.println(delaiArmement); - Serial.print("tempsVol = "); Serial.println(tempsVol); - Serial.print("servoStabVol = "); Serial.println(servoStabVol); - Serial.print("servoStabTreuil = "); Serial.println(servoStabTreuil); - Serial.print("servoStabDT = "); Serial.println(servoStabDT); - Serial.print("servoDeriveVol = "); Serial.println(servoDeriveVol); - Serial.print("servoDeriveTreuil = "); Serial.println(servoDeriveTreuil); - Serial.print("cli_ssid = "); Serial.println(cli_ssid); - Serial.print("cli_pwd = "); Serial.println(cli_pwd); - Serial.print("ap_ssid = "); Serial.println(ap_ssid); - Serial.print("ap_pwd = "); Serial.println(ap_pwd); + Serial.print("delaiArmement.......... = "); Serial.println(delaiArmement); + Serial.print("tempsVol............... = "); Serial.println(tempsVol); + Serial.print("servoStabVol........... = "); Serial.println(servoStabVol); + Serial.print("servoStabTreuil........ = "); Serial.println(servoStabTreuil); + Serial.print("servoStabDT............ = "); Serial.println(servoStabDT); + Serial.print("servoDeriveVol......... = "); Serial.println(servoDeriveVol); + Serial.print("servoDeriveTreuilTendu. = "); Serial.println(servoDeriveTreuilTendu); + Serial.print("servoDeriveTreuilVirage = "); Serial.println(servoDeriveTreuilVirage); + Serial.print("servoDeriveZoom........ = "); Serial.println(servoDeriveZoom); + Serial.print("cli_ssid............... = "); Serial.println(cli_ssid); + Serial.print("cli_pwd................ = "); Serial.println(cli_pwd); + Serial.print("ap_ssid................ = "); Serial.println(ap_ssid); + Serial.print("ap_pwd................. = "); Serial.println(ap_pwd); #endif - + servoStab.attach(PIN_SERVO_STAB); servoStab.writeMicroseconds(servoStabDT); servoDerive.attach(PIN_SERVO_DERIVE); servoDerive.writeMicroseconds(servoDeriveVol); #ifdef debug - Serial.print("setup() : Servo stab en position DT ("); Serial.print(servoStabDT); Serial.println(")"); - Serial.print("setup() : Servo derive en position vol ("); Serial.print(servoDeriveVol); Serial.println(")"); + Serial.print("setup() : Position initiale Servo stab en position DT ("); Serial.print(servoStabDT); Serial.println(")"); + Serial.print("setup() : Position initiale Servo derive en position vol ("); Serial.print(servoDeriveVol); Serial.println(")"); #endif - + pinMode(PIN_SWITCH, INPUT_PULLUP); pinMode(GND_SWITCH, OUTPUT); digitalWrite(GND_SWITCH, LOW); - + pinMode(PIN_ZOOM, INPUT_PULLUP); pinMode(GND_ZOOM, OUTPUT); digitalWrite(GND_ZOOM, LOW); - + pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, ledState); @@ -190,7 +195,7 @@ void setup() { Serial.flush(); #endif } - + /* AP ouverte si pas de mot de passe. */ WiFi.softAPConfig(apIP, apIP, netMsk); if (ap_pwd[0] == '\0') { @@ -252,16 +257,17 @@ void loop() { // On vient d'enfoncer la pédale du crochet // On positionne les 2 servos en mode treuillage servoStab.writeMicroseconds(servoStabTreuil); - servoDerive.writeMicroseconds(servoDeriveTreuil); + servoDerive.writeMicroseconds(servoDeriveTreuilTendu); #ifdef debug - Serial.print("Tension du crochet : Stab en position treuil, servoStabTreuil = "); Serial.println(servoStabTreuil); - Serial.print("Tension du crochet : Dérive en position treuil, servoDeriveTreuil = "); Serial.println(servoDeriveTreuil); + Serial.print("Tension du crochet : Stab en position treuil, servoStabTreuil = "); Serial.println(servoStabTreuil); + Serial.print("Tension du crochet : Dérive en position treuil, servoDeriveTreuilTendu = "); Serial.println(servoDeriveTreuilTendu); #endif if (timerStatus == STATUS_DT) { // On était en DT, on arme la minuterie timerStatus = STATUS_ARMEE; debut = millis(); blinkInterval = 1000; // 1 secondes + flagZoom = false; // Réinitialise le flag du Zoom #ifdef debug ////Serial.println("Servo en position départ."); Serial.println("timerStatus = STATUS_ARMEE"); @@ -285,17 +291,28 @@ void loop() { } } else { // new_crochet == CROCHET_RELACHE // Le cable vient de se relacher, - // On positionne les 2 servos en mode plané si on est pas déthermalisé if (timerStatus != STATUS_DT) { + // On positionne le servos stab en mode plané si on est pas déthermalisé servoStab.writeMicroseconds(servoStabVol); - servoDerive.writeMicroseconds(servoDeriveVol); #ifdef debug - Serial.print("Relâchement du crochet : Stab en position vol, servoStabVol = "); Serial.println(servoStabVol); - Serial.print("Relâchement du crochet : Dérive en position vol, servoDeriveVol = "); Serial.println(servoDeriveVol); + Serial.print("Relâchement du crochet : Stab en position vol, servoStabVol = "); Serial.println(servoStabVol); #endif + if (flagZoom) { + // Le zoom à été activé, donc c'est sensé être largué. => Dérive en position virage vol. + servoDerive.writeMicroseconds(servoDeriveVol); + #ifdef debug + Serial.print("Relâchement du crochet : Dérive en position vol, servoDeriveVol = "); Serial.println(servoDeriveVol); + #endif + } else { + // Le zoom n'a pas encore été activé, on est sensé être encore vérouillé. => Dérive en position virage treuil. + servoDerive.writeMicroseconds(servoDeriveTreuilVirage); + #ifdef debug + Serial.print("Relâchement du crochet : Dérive en position virage treuil, servoDeriveTreuilVirage = "); Serial.println(servoDeriveTreuilVirage); + #endif + } } if (timerStatus == STATUS_TREUIL) { - // Début du vol + // Début du vol (ou virage treuil) timerStatus = STATUS_VOL; debut = millis(); blinkInterval = 500; // 1/2 secondes @@ -319,21 +336,30 @@ void loop() { if ((new_zoom == ZOOM_ON) && (crochet == CROCHET_TENDU)) { // Servo dérive en position zoom servoDerive.writeMicroseconds(servoDeriveZoom); + flagZoom = true; // Utilisé pour passer du virage treuil au virage plané. #ifdef debug Serial.print("Activation zoom : Dérive en position zoom, servoDeriveZoom = "); Serial.println(servoDeriveZoom); #endif } else if ((new_zoom == ZOOM_OFF) && (crochet == CROCHET_TENDU)) { - // Servo dérive en position treuil - servoDerive.writeMicroseconds(servoDeriveTreuil); + // Servo dérive en position treuil tendu + servoDerive.writeMicroseconds(servoDeriveTreuilTendu); #ifdef debug - Serial.print("Désactivation zoom : Dérive en position treuil, servoDeriveTreuil = "); Serial.println(servoDeriveTreuil); + Serial.print("Désactivation zoom : Dérive en position treuil, servoDeriveTreuilTendu = "); Serial.println(servoDeriveTreuilTendu); #endif } else { - // Crochet détendu, servo dérive en position vol quelque soit l'état du switch zoom. - servoDerive.writeMicroseconds(servoDeriveVol); - #ifdef debug - Serial.print("Crochet détendu, zoom inactif : Dérive en position vol, servoDeriveVol = "); Serial.println(servoDeriveVol); - #endif + if (flagZoom) { + // Le zoom à été activé, donc c'est sensé être largué. => Dérive en position virage vol. + servoDerive.writeMicroseconds(servoDeriveVol); + #ifdef debug + Serial.print("Crochet détendu, zoom inactif : Dérive en position vol, servoDeriveVol = "); Serial.println(servoDeriveVol); + #endif + } else { + // Le zoom n'a pas encore été activé, on est sensé être encore vérouillé. => Dérive en position virage treuil. + servoDerive.writeMicroseconds(servoDeriveTreuilVirage); + #ifdef debug + Serial.print("Crochet détendu, zoom inactif : Dérive en position virage treuil, servoDeriveTreuilVirage = "); Serial.println(servoDeriveTreuilVirage); + #endif + } } zoom = new_zoom; } // if (new_zoom != zoom) diff --git a/WeTimer/handleConfig.cpp b/WeTimer/handleConfig.cpp index 339414e..f647909 100644 --- a/WeTimer/handleConfig.cpp +++ b/WeTimer/handleConfig.cpp @@ -22,7 +22,7 @@ #include #include "WeTimer.h" -#define NB_CONFIG_ITEMS 8 +#define NB_CONFIG_ITEMS 9 /** Handle root or redirect to captive portal */ void handleConfig() { @@ -33,7 +33,8 @@ void handleConfig() { F("servoStabTreuil"), F("servoStabDT"), F("servoDeriveVol"), - F("servoDeriveTreuil"), + F("servoDeriveTreuilTendu"), + F("servoDeriveTreuilVirage"), F("servoDeriveZoom") }; const String inputLabels[] = { @@ -43,7 +44,8 @@ void handleConfig() { F("Servo stab treuil (μs)"), F("Servo stab DT (μs)"), F("Servo derive vol (μs)"), - F("Servo derive treuil (μs)"), + F("Servo drv treuil tendu"), + F("Servo drv treuil virage"), F("Servo derive zoom (μs)") }; String inputValues[NB_CONFIG_ITEMS]; @@ -53,8 +55,9 @@ void handleConfig() { inputValues[3] = String(servoStabTreuil); inputValues[4] = String(servoStabDT); inputValues[5] = String(servoDeriveVol); - inputValues[6] = String(servoDeriveTreuil); - inputValues[7] = String(servoDeriveZoom); + inputValues[6] = String(servoDeriveTreuilTendu); + inputValues[7] = String(servoDeriveTreuilVirage); + inputValues[8] = String(servoDeriveZoom); String minValues[NB_CONFIG_ITEMS]; minValues[0] = String(0); minValues[1] = String(0); @@ -64,6 +67,7 @@ void handleConfig() { minValues[5] = String(MIN_SERVO_MICROSECONDS); minValues[6] = String(MIN_SERVO_MICROSECONDS); minValues[7] = String(MIN_SERVO_MICROSECONDS); + minValues[8] = String(MIN_SERVO_MICROSECONDS); String maxValues[NB_CONFIG_ITEMS]; maxValues[0] = String(9999); maxValues[1] = String(9999); @@ -73,6 +77,7 @@ void handleConfig() { maxValues[5] = String(MAX_SERVO_MICROSECONDS); maxValues[6] = String(MAX_SERVO_MICROSECONDS); maxValues[7] = String(MAX_SERVO_MICROSECONDS); + maxValues[8] = String(MAX_SERVO_MICROSECONDS); //-------------------------------------------------------------------------------- server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate"); diff --git a/WeTimer/handleSetParams.cpp b/WeTimer/handleSetParams.cpp index 972ef26..9623dfc 100644 --- a/WeTimer/handleSetParams.cpp +++ b/WeTimer/handleSetParams.cpp @@ -116,15 +116,27 @@ void handleSetParams() { Serial.flush(); #endif } - } else if (strncasecmp(server.argName(i).c_str(), "servoDeriveTreuil", (size_t)17) == 0) { - unsigned int newServoDeriveTreuil = server.arg(i).toInt(); - if ((servoDeriveTreuil != newServoDeriveTreuil) and (newServoDeriveTreuil >= MIN_SERVO_MICROSECONDS) and (newServoDeriveTreuil <= MAX_SERVO_MICROSECONDS)) { - servoDeriveTreuil = newServoDeriveTreuil; + } else if (strncasecmp(server.argName(i).c_str(), "servoDeriveTreuilTendu", (size_t)17) == 0) { + unsigned int newServoDeriveTreuilTendu = server.arg(i).toInt(); + if ((servoDeriveTreuilTendu != newServoDeriveTreuilTendu) and (newServoDeriveTreuilTendu >= MIN_SERVO_MICROSECONDS) and (newServoDeriveTreuilTendu <= MAX_SERVO_MICROSECONDS)) { + servoDeriveTreuilTendu = newServoDeriveTreuilTendu; parmUpdated = true; - EEPROM_writeInt(ADDR_SERVO_DERIVE_TREUIL, servoDeriveTreuil); + EEPROM_writeInt(ADDR_SERVO_DERIVE_TREUIL_TENDU, servoDeriveTreuilTendu); #ifdef debug - Serial.print("Mise à jour servoDeriveTreuil = "); - Serial.println(servoDeriveTreuil); + Serial.print("Mise à jour servoDeriveTreuilTendu = "); + Serial.println(servoDeriveTreuilTendu); + Serial.flush(); + #endif + } + } else if (strncasecmp(server.argName(i).c_str(), "servoDeriveTreuilVirage", (size_t)17) == 0) { + unsigned int newservoDeriveTreuilVirage = server.arg(i).toInt(); + if ((servoDeriveTreuilVirage != newservoDeriveTreuilVirage) and (newservoDeriveTreuilVirage >= MIN_SERVO_MICROSECONDS) and (newservoDeriveTreuilVirage <= MAX_SERVO_MICROSECONDS)) { + servoDeriveTreuilVirage = newservoDeriveTreuilVirage; + parmUpdated = true; + EEPROM_writeInt(ADDR_SERVO_DERIVE_TREUIL_VIRAGE, servoDeriveTreuilVirage); + #ifdef debug + Serial.print("Mise à jour servoDeriveTreuilVirage = "); + Serial.println(servoDeriveTreuilVirage); Serial.flush(); #endif } diff --git a/doc/Installation WeTimer.pdf b/doc/Installation WeTimer.pdf index c9d730f..d5eab5a 100644 Binary files a/doc/Installation WeTimer.pdf and b/doc/Installation WeTimer.pdf differ diff --git a/doc/Notice WeTimer.pdf b/doc/Notice WeTimer.pdf index 8c38009..47aaf14 100644 Binary files a/doc/Notice WeTimer.pdf and b/doc/Notice WeTimer.pdf differ diff --git a/doc/doc.src/install_et_flash/Installation WeTimer.odt b/doc/doc.src/install_et_flash/Installation WeTimer.odt index db47e9c..56451b5 100644 Binary files a/doc/doc.src/install_et_flash/Installation WeTimer.odt and b/doc/doc.src/install_et_flash/Installation WeTimer.odt differ diff --git a/doc/doc.src/install_et_flash/images/ArduinoEraseAllFlash.png b/doc/doc.src/install_et_flash/images/ArduinoEraseAllFlash.png new file mode 100644 index 0000000..ad761c2 Binary files /dev/null and b/doc/doc.src/install_et_flash/images/ArduinoEraseAllFlash.png differ diff --git a/doc/doc.src/utilisation/Notice WeTimer v0.9.7.odt b/doc/doc.src/utilisation/Notice WeTimer v0.9.7.odt new file mode 100644 index 0000000..fceb7aa Binary files /dev/null and b/doc/doc.src/utilisation/Notice WeTimer v0.9.7.odt differ diff --git a/doc/doc.src/utilisation/Synoptique.svg b/doc/doc.src/utilisation/Synoptique.svg index d57e3cc..84af048 100644 --- a/doc/doc.src/utilisation/Synoptique.svg +++ b/doc/doc.src/utilisation/Synoptique.svg @@ -13,7 +13,7 @@ version="1.1" id="svg1126" inkscape:version="1.0.2 (e86c870879, 2021-01-15)" - sodipodi:docname="Synoptique fonctionnement.svg"> + sodipodi:docname="Synoptique.svg"> image/svg+xml - + @@ -230,7 +230,7 @@ style="fill:#abccd8;fill-opacity:1;stroke:#3f3f3f;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none" id="rect1632" width="385" - height="29.999989" + height="44.999989" x="315.6496" y="690" /> - servo de dérive reste position vol. + id="tspan887">- servo de dérive reste position vol.- réinitialisation zoom => crochet fermé + width="580" + height="98.224495" + x="95.649605" + y="745" /> Minuterie en "mode Vol" :- servo stabilisateur passe en position vol,- servo de dérive passe en position vol. + id="tspan955">- si crochet fermé => dérive en position virage treuil,- si crochet ouvert =>dérive n position virage vol. + sodipodi:nodetypes="cc" /> + sodipodi:nodetypes="cc" /> La LED clignote(fréquence 1 secondes) switch zoom - servo de dérive passe en position ZOOM. + style="font-size:13.6876px;line-height:1.25;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans';letter-spacing:0px;word-spacing:0px;stroke-width:1" + x="316.81326" + y="729.26154" + id="text1763" + transform="scale(1.026573,0.97411486)">- servo de dérive passe en position ZOOM.- Mémorise l'activation du zoom =>croché ouvert