First step of a config menu
This commit is contained in:
parent
9601c164b6
commit
1e7142aaab
|
@ -12,9 +12,9 @@ LiquidCrystal lcd( 9, 17, 15, 16, 14, 10);
|
|||
// CONSTANTES
|
||||
//-----------------------------------------------------------
|
||||
|
||||
const int D_Flash = 10; //Durée du flash en µs, autour de 10µs
|
||||
int D_Flash = 10; //Durée du flash en µs, autour de 10µs
|
||||
const int deg_Initial = 10; //Affiché au demarrage
|
||||
const int Ncyl = 2;
|
||||
int Ncyl = 2;
|
||||
const int Refresh = 100;
|
||||
|
||||
#define Etin 2
|
||||
|
@ -71,11 +71,37 @@ void Affic_N_et_deg_dem() //Fond d'ecran inchangé,durée environ 7.5ms
|
|||
|
||||
void ConfiG()
|
||||
{
|
||||
while (digitalRead(Inter) == 0); //toujours appuyé ? on attend
|
||||
lcd.clear();
|
||||
lcd.print("CONFIG");
|
||||
lcd.setCursor(3, 1);
|
||||
lcd.print("....");
|
||||
lcd.setCursor(7, 1);
|
||||
lcd.print((char)126);
|
||||
while (digitalRead(Inter) == 1); //Attend un appui
|
||||
while (digitalRead(Inter) == 0); // et un relachement
|
||||
|
||||
lcd.clear();
|
||||
lcd.print("Nb cyl.");
|
||||
Enco.write(Ncyl*4);
|
||||
while (digitalRead(Inter) == 1){ // tant qu'on appuie pas on régle
|
||||
Ncyl = Enco.read()/4;
|
||||
lcd.setCursor(3, 1);
|
||||
lcd.print(Ncyl);
|
||||
lcd.print(" ");
|
||||
|
||||
}
|
||||
while (digitalRead(Inter) == 0); // Si on a appuyé, on attend le relachement
|
||||
|
||||
lcd.clear();
|
||||
lcd.print("D Flash");
|
||||
Enco.write(D_Flash*4);
|
||||
while (digitalRead(Inter) == 1){ // tant qu'on appuie pas on régle
|
||||
D_Flash = Enco.read()/4
|
||||
lcd.setCursor(3, 1);
|
||||
lcd.print(D_Flash);
|
||||
lcd.print(" ");
|
||||
}
|
||||
|
||||
while (digitalRead(Inter) == 0);
|
||||
IniT();
|
||||
}
|
||||
|
||||
|
@ -99,8 +125,7 @@ void IniT() {
|
|||
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);
|
||||
delay(100);
|
||||
modconfig=0;
|
||||
ConfiG();
|
||||
}
|
||||
|
@ -108,6 +133,7 @@ void IniT() {
|
|||
lcd.clear();
|
||||
lcd.setCursor(5, 0);
|
||||
lcd.print("tpm");
|
||||
//lcd.print(Ncyl);
|
||||
lcd.setCursor(5, 1);
|
||||
lcd.print("deg");
|
||||
Enco.write(deg_Initial*4);
|
||||
|
|
Loading…
Reference in New Issue