diverses modifications, debug
This commit is contained in:
parent
6d65aa13cd
commit
c33d69fa16
72
src/main.cpp
72
src/main.cpp
|
@ -71,13 +71,31 @@ const char *ssid = "IFV-Sporix"; // SSID
|
||||||
const char *password = "12345678"; // PASSWORD, 8 caractères minimum
|
const char *password = "12345678"; // PASSWORD, 8 caractères minimum
|
||||||
WiFiServer server(80); // port du serveur
|
WiFiServer server(80); // port du serveur
|
||||||
|
|
||||||
|
////////////////////////////
|
||||||
|
/// FONCTION CODE ERREUR ///
|
||||||
|
////////////////////////////
|
||||||
|
|
||||||
|
void errorCode(char codeNumber) {
|
||||||
|
while(1) {
|
||||||
|
//char i=0;
|
||||||
|
delay(4700);
|
||||||
|
for( int i=0 ; i=codeNumber ; ++i ){
|
||||||
|
digitalWrite(LED, HIGH);
|
||||||
|
delay(300);
|
||||||
|
digitalWrite(LED, LOW);
|
||||||
|
delay(300);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////
|
///////////////////////////
|
||||||
/* FONCTIONS DU COMPTEUR */
|
/* FONCTIONS DU COMPTEUR */
|
||||||
///////////////////////////
|
///////////////////////////
|
||||||
|
|
||||||
void start_compteur() {
|
void start_compteur() {
|
||||||
|
|
||||||
esp_err_t error;
|
//esp_err_t error;
|
||||||
|
|
||||||
Serial.println("Initialisation du compteur");
|
Serial.println("Initialisation du compteur");
|
||||||
|
|
||||||
|
@ -274,11 +292,11 @@ void sd_init() {
|
||||||
}
|
}
|
||||||
Serial.println("balise 01");
|
Serial.println("balise 01");
|
||||||
DateTime now = rtc.now();
|
DateTime now = rtc.now();
|
||||||
fileName[1] = '/';
|
fileName[0] = '/';
|
||||||
fileName[2] = now.month();
|
fileName[1] = now.month();
|
||||||
fileName[3] = now.day();
|
fileName[2] = now.day();
|
||||||
fileName[4] = now.hour();
|
fileName[3] = now.hour();
|
||||||
fileName[5] = now.minute();
|
fileName[4] = now.minute();
|
||||||
char entete[64] = "fichier de data";
|
char entete[64] = "fichier de data";
|
||||||
writeFile(SD, fileName, entete);
|
writeFile(SD, fileName, entete);
|
||||||
}
|
}
|
||||||
|
@ -286,39 +304,23 @@ void sd_init() {
|
||||||
void scribe_sd (){
|
void scribe_sd (){
|
||||||
DateTime now = rtc.now();
|
DateTime now = rtc.now();
|
||||||
char buffer[64];
|
char buffer[64];
|
||||||
snprintf(buffer, sizeof buffer, "%f", vRotReel);
|
snprintf(buffer, sizeof buffer, "%d", vRotReel);
|
||||||
horodatage[1] = now.year();
|
horodatage[0] = now.year();
|
||||||
horodatage[2] = '-';
|
horodatage[1] = '-';
|
||||||
horodatage[3] = now.month();
|
horodatage[2] = now.month();
|
||||||
horodatage[4] = '-';
|
horodatage[3] = '-';
|
||||||
horodatage[5] = now.day();
|
horodatage[4] = now.day();
|
||||||
horodatage[6] = '-';
|
horodatage[5] = '-';
|
||||||
horodatage[7] = now.hour();
|
horodatage[6] = now.hour();
|
||||||
horodatage[8] = ':';
|
horodatage[7] = ':';
|
||||||
horodatage[9] = now.minute();
|
horodatage[8] = now.minute();
|
||||||
horodatage[10] = ':';
|
horodatage[9] = ':';
|
||||||
horodatage[11] = now.second();
|
horodatage[10] = now.second();
|
||||||
horodatage[12] = ' ';
|
horodatage[11] = ' ';
|
||||||
appendFile(SD, fileName, horodatage);
|
appendFile(SD, fileName, horodatage);
|
||||||
appendFile(SD, fileName, buffer);
|
appendFile(SD, fileName, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////
|
|
||||||
/// FONCTION CODE ERREUR ///
|
|
||||||
////////////////////////////
|
|
||||||
|
|
||||||
void errorCode(char codeNumber) {
|
|
||||||
while(1) {
|
|
||||||
char i=0;
|
|
||||||
delay(4700);
|
|
||||||
for(i=0; i=codeNumber; ++i){
|
|
||||||
digitalWrite(LED, HIGH);
|
|
||||||
delay(300);
|
|
||||||
digitalWrite(LED, LOW);
|
|
||||||
delay(300);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////
|
/////////////////////
|
||||||
/// FONCTIONS RTC ///
|
/// FONCTIONS RTC ///
|
||||||
|
|
Loading…
Reference in a new issue