This commit is contained in:
grouch 2017-04-14 19:04:05 +02:00
parent 34e2f5e5aa
commit 9601c164b6
1 changed files with 24 additions and 0 deletions

View File

@ -38,6 +38,7 @@ int unsigned long N = 0; //N en tours/mn, peut monter à plus de 44 000, 4 temp
int unsigned long Nc = 0; //Pour le calcul de N
volatile int signed deg_dem = deg_Initial; //Compteur des degrés demandés,affiché au LCD, <=0 possible
unsigned long pm = 0; //Previous millis pour Refresh LCD
int modconfig = 0; //Flag pour savoir si on est en mode config
int debug = 0; //Variable pour debug, optionelle
@ -68,6 +69,16 @@ void Affic_N_et_deg_dem() //Fond d'ecran inchangé,durée environ 7.5ms
lcd.setCursor(0, 1); lcd.print(deg_dem);
}
void ConfiG()
{
lcd.clear();
lcd.print("CONFIG");
lcd.setCursor(3, 1);
lcd.print("....");
while (digitalRead(Inter) == 1); //Attend un appui
IniT();
}
void IniT() {
attachInterrupt(digitalPinToInterrupt(Etin), isrEtincelle, RISING);
Timer1.attachInterrupt(isrFlash); //Timer entre Etincelle et Flash
@ -78,12 +89,22 @@ void IniT() {
lcd.setCursor(3, 1);
lcd.print("duino");
delay(1500);
if (digitalRead(Inter) == 0) {modconfig++;} //si bouton appuyé
lcd.clear();
lcd.print("Version");
lcd.setCursor(0, 1);
digitalWrite (Flash, 1); delayMicroseconds(D_Flash); digitalWrite (Flash, 0);
lcd.print(Ver); //N° de version
delay(1000);
if (digitalRead(Inter) == 0) {modconfig++;} //si bouton toujours appuyé
if (modconfig >= 2){ // on entre dans le mode config
lcd.clear();
lcd.print("Config...");
delay(1000);
modconfig=0;
ConfiG();
}
lcd.clear();
lcd.setCursor(5, 0);
lcd.print("tpm");
@ -93,6 +114,9 @@ void IniT() {
Nc = 120000000 / Ncyl;
T = 150000;
D_deg = T / 2; //Pour le premier affichage de N
Affic_N_et_deg_dem();
}