Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Arduino.h>
- #include<LiquidCrystal.h>
- #include<Wire.h>
- #include<DS3231.h>
- LiquidCrystal lcd ( , , , , , );
- DS3231 clock;
- RTCDateTime dt;
- //////////////
- int hour_start = 0 ; min_start = 0 ; second_start = 0;
- int hour_left = 0; int min_left = 0; int second_left = 0;
- int hour_timer , min_timer , second_timer ;
- //mettre les pin des relais sur l'arduino
- int relay1 = ;// 1 contacteur == 2resistor+ 1 electrovanne pompe
- int relay2 = ;// 1 contacteur == 1 pompe a activer en d¨¦caler
- ////////////// mettre les pin de l'arduino des bouton
- int button_up = ;
- int button_down = ;
- int button_valid = ;
- int button_return = ;
- //////////////
- int volume_left = 0; // volume actuel dans la cuve (pour le dernière écran a la fin )
- int volume_end = 0; // volume a mettre dans la cuve
- //////////////
- unsigned long timer ;
- unsigned long last_timer = 0 ;
- boolean clignotement = 1 ;
- ////////////
- int num_menu = 1; // numéro du menu associé
- int pos_menu = 0; // position dans le menu (caractère pour le sous menu
- int num_ligne = 0; //ligne de selection sur l'écran lcd
- ////////////
- ////////////
- void setup()
- {
- lcd.begin(16,2);
- lcd.setCursor(0,0);
- lcd.leftToRight();
- lcd.print("lancement . . . ");
- delay(3000);
- lcd.noCursor();
- pinMode(button_down,INPUT);
- pinMode(button_up,INPUT);
- pinMode(button_valid,INPUT);
- pinMode(button_return,INPUT);
- pinMode(relay1,OUTPUT);
- pinMode(relay2,OUTPUT);
- lcd.clear();
- }
- void blinkln (int ligne , char texte)
- {
- timer = millis() - last_timer;
- if (timer< 200 )
- {
- switch(clignotement)
- {
- case 0 :
- {
- lcd.setCursor(0 , ligne);
- lcd.print(texte));
- clignotement = 1 ;
- last_timer= millis();
- break;
- }
- case 1 :
- {
- lcd.setCursor(0,ligne);
- lcd.print(" ");
- clignotement = 0;
- break ;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement