changements compte-tour & scribe
This commit is contained in:
parent
f17b510289
commit
3eee6cd17a
|
@ -24,6 +24,7 @@ bool sem_scribe = false; // sémaphore pour le compteur
|
|||
int16_t count = 0; // variable de compteur
|
||||
int16_t old_count = 0;
|
||||
int vRotReel; // vitesse réelle mesurée du moteur
|
||||
unsigned long chrono_scribe;
|
||||
unsigned long start_chrono_scribe= 0; // minuteur pour le déclenchement du compteur
|
||||
bool sema_compte_tour = false; // semaphore poour le compte tour
|
||||
unsigned long depart_compte_tour = 0; // valeur de millis au déclenchement du compte-tour
|
||||
|
@ -335,15 +336,14 @@ void scribe_sd (){
|
|||
pcnt_counter_pause(PCNT_TEST_UNIT);
|
||||
pcnt_counter_clear(PCNT_TEST_UNIT);
|
||||
pcnt_counter_resume(PCNT_TEST_UNIT);
|
||||
start_chrono_scribe = millis();
|
||||
|
||||
start_chrono_scribe = millis();
|
||||
}
|
||||
if ( sem_scribe == true && (millis() - start_chrono_scribe) >= intervalle_d_ecriture ){
|
||||
chrono_scribe = millis() - start_chrono_scribe;
|
||||
if ( sem_scribe == true && chrono_scribe >= intervalle_d_ecriture ){
|
||||
Serial.println("balise scribe");
|
||||
char timestamp[] = "YY-MM-DD-hh:mm:ss";
|
||||
char *horodatage = now.toString(timestamp);
|
||||
char buffer[64];
|
||||
int chrono_scribe = millis() - start_chrono_scribe;
|
||||
int vRotMoyen = count*60000/(pptr*chrono_scribe);
|
||||
snprintf(buffer, sizeof buffer, "%d", vRotMoyen);
|
||||
appendFile(SD, fichier, horodatage);
|
||||
|
|
Loading…
Reference in a new issue