Advertisement
Tecnelm

Untitled

Aug 26th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.09 KB | None | 0 0
  1. #include <Arduino.h>
  2. #include<LiquidCrystal.h>
  3. #include<Wire.h>
  4. #include<DS3231.h>
  5.  
  6. LiquidCrystal lcd (  ,  ,  ,  ,  ,  );
  7. DS3231 clock;
  8. RTCDateTime dt;
  9.  
  10. //////////////
  11. int hour_start = 0 ; min_start = 0 ; second_start = 0;
  12. int hour_left = 0; int min_left = 0; int second_left = 0;
  13. int hour_timer , min_timer , second_timer ;
  14. //mettre les pin des relais sur l'arduino
  15. int relay1 = ;// 1 contacteur  ==  2resistor+ 1 electrovanne pompe
  16. int relay2  = ;// 1 contacteur == 1 pompe a activer en d¨¦caler
  17. ////////////// mettre les pin  de l'arduino des bouton
  18. int button_up = ;
  19. int button_down = ;
  20. int button_valid = ;
  21. int button_return = ;
  22. //////////////
  23. int volume_left = 0; // volume actuel dans la cuve (pour le dernière écran a la fin )
  24. int volume_end  = 0;       // volume  a mettre dans la cuve
  25. //////////////
  26. unsigned long timer ;
  27. unsigned long last_timer = 0 ;
  28. boolean clignotement = 1 ;
  29. ////////////
  30. int num_menu = 1; // numéro du menu associé
  31. int pos_menu = 0; // position  dans le menu (caractère pour le sous menu
  32. int num_ligne = 0; //ligne de selection sur l'écran lcd
  33. ////////////
  34. ////////////
  35. void setup()
  36.  {
  37.      lcd.begin(16,2);
  38.      lcd.setCursor(0,0);
  39.      lcd.leftToRight();
  40.      lcd.print("lancement . . . ");
  41.      delay(3000);
  42.      lcd.noCursor();
  43.      pinMode(button_down,INPUT);
  44.      pinMode(button_up,INPUT);
  45.      pinMode(button_valid,INPUT);
  46.      pinMode(button_return,INPUT);
  47.      pinMode(relay1,OUTPUT);
  48.      pinMode(relay2,OUTPUT);
  49.      lcd.clear();
  50.  
  51.  
  52.  }
  53.  void blinkln (int ligne , char texte)
  54.  {
  55.      timer = millis() - last_timer;
  56.      if (timer< 200 )
  57.      {
  58.          switch(clignotement)
  59.          {
  60.          case 0 :
  61.             {
  62.                 lcd.setCursor(0 , ligne);
  63.                 lcd.print(texte));
  64.                 clignotement = 1 ;
  65.                 last_timer= millis();
  66.                 break;
  67.             }
  68.          case 1 :
  69.             {
  70.                 lcd.setCursor(0,ligne);
  71.                 lcd.print("                ");
  72.                 clignotement = 0;
  73.                 break ;
  74.             }
  75.          }
  76.      }
  77.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement