Ollivier

Telecommande IR controle de LEDs

Sep 3rd, 2020 (edited)
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 19.96 KB | None | 0 0
  1. // Ollivier JULLIEN
  2. // MARSEILLE - 2020
  3. // 100% libre de droits
  4.  
  5. // Télé commande PHILIPS 37 boutons https://imtc.qccdn.fr/test/adaptateur-tnt-hd-mpeg4/zoom/philips-dtr3000_003.jpg (Décodeur TNT ??)
  6. // Ecran LCD RVB https://wiki.dfrobot.com/Gravity__I2C_16x2_Arduino_LCD_with_RGB_Backlight_Display_SKU__DFR0464
  7. // 1 BP
  8. // 8 LEDs
  9. // exercice de d'utilisation de la télécommande
  10. // et découverte de l'écran
  11. // Une action sur chaque bouton
  12. // une action sur le BP
  13. // = 38 action sur 2 pins (intéressant, non ?)
  14. // pas mal pour piloter mes futurs projets (tant que je n'ai besoin que du simple clic)
  15. // le code pour récupérer se trouve sur ce lien : https://pastebin.com/0rNwwFq5
  16. // (fichier lourd, mais fonctionnel, c'est la première version)
  17.  
  18. #include <avr/pgmspace.h>
  19. #include <IRremote.h>
  20.  
  21. int LedIRLecture = 11;
  22. IRrecv recepteurIR(LedIRLecture);
  23. decode_results resultat;
  24.  
  25. #include <Wire.h>
  26. #include <DFRobot_RGBLCD.h>
  27.  
  28. DFRobot_RGBLCD lcd(16, 2);
  29.  
  30. int r, v, b;
  31. int ancienR, ancienV, ancienB;
  32.  
  33. const char valeurBouton_0[] PROGMEM = "fb003bc4";
  34. const char valeurBouton_1[] PROGMEM = "fb00d12e";
  35. const char valeurBouton_2[] PROGMEM = "fb00936c";
  36. const char valeurBouton_3[] PROGMEM = "fb0013ec";
  37. const char valeurBouton_4[] PROGMEM = "fb009966";
  38. const char valeurBouton_5[] PROGMEM = "fb00b34c";
  39. const char valeurBouton_6[] PROGMEM = "fb00e31c";
  40. const char valeurBouton_7[] PROGMEM = "fb00639c";
  41. const char valeurBouton_8[] PROGMEM = "fb00a35c";
  42. const char valeurBouton_9[] PROGMEM = "fb0023dc";
  43. const char valeurBouton_10[] PROGMEM = "fb00f906";
  44. const char valeurBouton_11[] PROGMEM = "fb00d926";
  45. const char valeurBouton_12[] PROGMEM = "fb007b84";
  46. const char valeurBouton_13[] PROGMEM = "fb006b94";
  47. const char valeurBouton_14[] PROGMEM = "fb00db24";
  48. const char valeurBouton_15[] PROGMEM = "fb001be4";
  49. const char valeurBouton_16[] PROGMEM = "fb005ba4";
  50. const char valeurBouton_17[] PROGMEM = "fb002bd4";
  51. const char valeurBouton_18[] PROGMEM = "fb00eb14";
  52. const char valeurBouton_19[] PROGMEM = "fb00c13e";
  53. const char valeurBouton_20[] PROGMEM = "fb00738c";
  54. const char valeurBouton_21[] PROGMEM = "fb00b946";
  55. const char valeurBouton_22[] PROGMEM = "fb00bb44";
  56. const char valeurBouton_23[] PROGMEM = "fb000bf4";
  57. const char valeurBouton_24[] PROGMEM = "fb0033cc";
  58. const char valeurBouton_25[] PROGMEM = "fb00718e";
  59. const char valeurBouton_26[] PROGMEM = "fb00619e";
  60. const char valeurBouton_27[] PROGMEM = "fb00f10e";
  61. const char valeurBouton_28[] PROGMEM = "fb0049b6";
  62. const char valeurBouton_29[] PROGMEM = "fb00e11e";
  63. const char valeurBouton_30[] PROGMEM = "fb00c936";
  64. const char valeurBouton_31[] PROGMEM = "fb006996";
  65. const char valeurBouton_32[] PROGMEM = "fb0041be";
  66. const char valeurBouton_33[] PROGMEM = "fb00e916";
  67. const char valeurBouton_34[] PROGMEM = "fb0059a6";
  68. const char valeurBouton_35[] PROGMEM = "fb00fb04";
  69. const char valeurBouton_36[] PROGMEM = "fb00916e";
  70.  
  71. const char *const valeur_recue[] PROGMEM = {
  72.   valeurBouton_0, valeurBouton_1, valeurBouton_2, valeurBouton_3, valeurBouton_4, valeurBouton_5, valeurBouton_6, valeurBouton_7, valeurBouton_8, valeurBouton_9,
  73.   valeurBouton_10, valeurBouton_11, valeurBouton_12, valeurBouton_13, valeurBouton_14, valeurBouton_15, valeurBouton_16, valeurBouton_17, valeurBouton_18, valeurBouton_19,
  74.   valeurBouton_20, valeurBouton_21, valeurBouton_22, valeurBouton_23, valeurBouton_24, valeurBouton_25, valeurBouton_26, valeurBouton_27, valeurBouton_28, valeurBouton_29,
  75.   valeurBouton_30, valeurBouton_31, valeurBouton_32, valeurBouton_33, valeurBouton_34, valeurBouton_35, valeurBouton_36
  76. };
  77.  
  78. char monBufferValeur[15];
  79.  
  80. const char nomBouton_0[] PROGMEM = "ON / OFF";
  81. const char nomBouton_1[] PROGMEM = "MUTE";
  82. const char nomBouton_2[] PROGMEM = "NEXT";
  83. const char nomBouton_3[] PROGMEM = "STOP";
  84. const char nomBouton_4[] PROGMEM = "REC";
  85. const char nomBouton_5[] PROGMEM = "INFO";
  86. const char nomBouton_6[] PROGMEM = "TV / RADIO";
  87. const char nomBouton_7[] PROGMEM = "MEDIA";
  88. const char nomBouton_8[] PROGMEM = "AUDIO";
  89. const char nomBouton_9[] PROGMEM = "BLEU";
  90. const char nomBouton_10[] PROGMEM = "EPG";
  91. const char nomBouton_11[] PROGMEM = "BACK";
  92. const char nomBouton_12[] PROGMEM = "HAUT";
  93. const char nomBouton_13[] PROGMEM = "BAS";
  94. const char nomBouton_14[] PROGMEM = "GAUCHE";
  95. const char nomBouton_15[] PROGMEM = "DROITE";
  96. const char nomBouton_16[] PROGMEM = "OK";
  97. const char nomBouton_17[] PROGMEM = "MENU";
  98. const char nomBouton_18[] PROGMEM = "EXIT";
  99. const char nomBouton_19[] PROGMEM = "USB";
  100. const char nomBouton_20[] PROGMEM = "FAV";
  101. const char nomBouton_21[] PROGMEM = "<<";
  102. const char nomBouton_22[] PROGMEM = ">>";
  103. const char nomBouton_23[] PROGMEM = "|<<";
  104. const char nomBouton_24[] PROGMEM = ">>|";
  105. const char nomBouton_25[] PROGMEM = "1";
  106. const char nomBouton_26[] PROGMEM = "2";
  107. const char nomBouton_27[] PROGMEM = "3";
  108. const char nomBouton_28[] PROGMEM = "4";
  109. const char nomBouton_29[] PROGMEM = "5";
  110. const char nomBouton_30[] PROGMEM = "6";
  111. const char nomBouton_31[] PROGMEM = "7";
  112. const char nomBouton_32[] PROGMEM = "8";
  113. const char nomBouton_33[] PROGMEM = "9";
  114. const char nomBouton_34[] PROGMEM = "0";
  115. const char nomBouton_35[] PROGMEM = "TTX";
  116. const char nomBouton_36[] PROGMEM = "SUBTITLE";
  117.  
  118. const char *const nom_valeur_recue[] PROGMEM = {
  119.   nomBouton_0, nomBouton_1, nomBouton_2, nomBouton_3, nomBouton_4, nomBouton_5, nomBouton_6, nomBouton_7, nomBouton_8, nomBouton_9,
  120.   nomBouton_10, nomBouton_11, nomBouton_12, nomBouton_13, nomBouton_14, nomBouton_15, nomBouton_16, nomBouton_17, nomBouton_18, nomBouton_19,
  121.   nomBouton_20, nomBouton_21, nomBouton_22, nomBouton_23, nomBouton_24, nomBouton_25, nomBouton_26, nomBouton_27, nomBouton_28, nomBouton_29,
  122.   nomBouton_30, nomBouton_31, nomBouton_32, nomBouton_33, nomBouton_34, nomBouton_35, nomBouton_36
  123. };
  124.  
  125. char monBufferNom[20];
  126.  
  127. int boutonActif;
  128.  
  129. const int pinLEDTemoin = 3;
  130. bool etatLED = false;
  131.  
  132. const int pinLEDRouge = 9;
  133. bool etatLEDRouge = false;
  134.  
  135. const int pinLEDRougeModule = 8;
  136. bool etatLEDRougeModule = false;
  137.  
  138. const int pinLEDJauneModule = 7;
  139. bool etatLEDJauneModule = false;
  140.  
  141. const int pinLEDVertModule = 5;
  142. bool etatLEDVertModule = false;
  143.  
  144. const int pinLEDBleuModule = 4;
  145. bool etatLEDBleuModule = false;
  146.  
  147. const int pinLEDBlancModule = 12;
  148. bool etatLEDBlancModule = false;
  149.  
  150. const int pinBoutonBP = 6;
  151. bool etatBP = true;
  152. bool ancienEtatBP = false;
  153.  
  154. int rotationCouleur = 0;
  155.  
  156.  
  157. void recupInfos (const char *const tableauValeur[], const char *const tableauNom[], int rang) {
  158.  
  159.   strcpy_P(monBufferValeur, (char *)pgm_read_word(&(tableauValeur[rang])));
  160.   strcpy_P(monBufferNom, (char *)pgm_read_word(&(tableauNom[rang])));
  161.  
  162. }
  163.  
  164. void afficheResultats (String valeur, String nom) {
  165.   lcd.noCursor();
  166.   lcd.stopBlink();
  167.   lcd.setCursor(0, 0);
  168.   lcd.print(F("Code : "));
  169.   lcd.print(valeur);
  170.   lcd.setCursor(0, 1);
  171.   lcd.print(F("                 "));
  172.   lcd.setCursor(0, 1);
  173.   lcd.print(F("Bouton "));
  174.   lcd.print(nom);
  175. }
  176. #define __FILENAME__ (strrchr("\\" __FILE__, '\\') + 1)
  177. void setup() {
  178.   recepteurIR.enableIRIn();
  179.  
  180.   pinMode(pinLEDTemoin, OUTPUT);
  181.   pinMode(pinLEDRouge, OUTPUT);
  182.   pinMode(pinLEDRougeModule, OUTPUT);
  183.   pinMode(pinLEDJauneModule, OUTPUT);
  184.   pinMode(pinLEDVertModule, OUTPUT);
  185.   pinMode(pinLEDBleuModule, OUTPUT);
  186.   pinMode(pinLEDBlancModule, OUTPUT);
  187.   pinMode(pinBoutonBP, INPUT);
  188.  
  189.   lcd.init();
  190.   r = 255;
  191.   v = 204;
  192.   b = 0;
  193.  
  194.  
  195.   lcd.setRGB(r, v, b);
  196.   lcd.setCursor(0, 0);
  197.   lcd.print(F("*INITIALISATION*"));
  198.   lcd.setCursor(0, 1);
  199.   lcd.print(F("BIENVENUS =^..^="));
  200.   delay(1500);
  201.   lcd.setCursor(0, 0);
  202.   lcd.print(__FILENAME__);
  203.   lcd.setCursor(0, 1);
  204.   lcd.print("   " __DATE__ "   ");
  205.   delay(1500);
  206.   for (int positionCounter = 0; positionCounter < 20; positionCounter++) {
  207.     lcd.scrollDisplayLeft();
  208.     delay(500);
  209.   }
  210.   lcd.noDisplay();
  211.   for (int positionCounter = 0; positionCounter < 36; positionCounter++) {
  212.     lcd.scrollDisplayRight();
  213.   }
  214.   lcd.display();
  215.   for (int positionCounter = 0; positionCounter < 16; positionCounter++) {
  216.     lcd.scrollDisplayLeft();
  217.     delay(500);
  218.   }
  219.   delay(5000);
  220.   lcd.clear();
  221.   lcd.setCursor(0, 0);
  222.   lcd.print(F("A vous de jouer,"));
  223.   lcd.setCursor(0, 1);
  224.   lcd.print(F("(tele) commandez"));
  225. }
  226.  
  227. void loop() {
  228.  
  229.   lcd.setRGB(r, v, b);
  230.   etatBP = digitalRead(pinBoutonBP);
  231.  
  232.   if (etatBP == false && ancienEtatBP == true) {
  233.     if (etatLED == false) {
  234.       digitalWrite(pinLEDTemoin, HIGH);
  235.     } else {
  236.       digitalWrite(pinLEDTemoin, LOW);
  237.     }
  238.     etatLED = !etatLED;
  239.   }
  240.   ancienEtatBP = etatBP;
  241.   delay(100);
  242.  
  243.   if (recepteurIR.decode(&resultat)) {
  244.     String valeur = String(resultat.value, HEX);            // on récupère la valeur reçue sous la forme d'une chaine de caractères
  245.     if (valeur.substring(0, 2) == "fb" && valeur.length() == 8) {      // si valeur reçue commence par fb et est de 8 caractères
  246.       for (int i = 0; i < 37; i++) {                        // on compare aux valeurs enregistrées dans le tableau
  247.         recupInfos (valeur_recue, nom_valeur_recue, i);
  248.         if (valeur == monBufferValeur) {             // si l'une correspond
  249.           boutonActif = i;                                  // son numero de rang devient le repère de ce bouton
  250.           afficheResultats (monBufferValeur, monBufferNom);
  251.           break;
  252.         }
  253.       }
  254.       switch (boutonActif) {
  255.         case 0:                                             // le numéro de cas correspond à la position de la valeur correspondante dans le tableau
  256.           for (int k = 0; k < 255; k++)
  257.           {
  258.             lcd.setPWM(REG_RED, k);
  259.             lcd.setPWM(REG_GREEN, k);
  260.             lcd.setPWM(REG_BLUE, k);
  261.             delay(5);
  262.           }
  263.  
  264.           delay(500);
  265.           for (int l = 254; l >= 0; l--)
  266.           {
  267.             lcd.setPWM(REG_RED, l);
  268.             lcd.setPWM(REG_GREEN, l);
  269.             lcd.setPWM(REG_BLUE, l);
  270.             delay(5);
  271.           }
  272.  
  273.           delay(500);
  274.           break;
  275.         case 1:
  276.           etatLEDBlancModule = !etatLEDBlancModule;
  277.           if (etatLEDBlancModule == true) {
  278.             digitalWrite(pinLEDBlancModule, HIGH);
  279.           } else {
  280.             digitalWrite(pinLEDBlancModule, LOW);
  281.           }
  282.           break;
  283.         case 2:
  284.           for (int positionCounter = 0; positionCounter < 15; positionCounter++) {
  285.             lcd.scrollDisplayLeft();
  286.             delay(500);
  287.           }
  288.  
  289.           for (int positionCounter = 0; positionCounter < 31; positionCounter++) {
  290.             lcd.scrollDisplayRight();
  291.             delay(500);
  292.           }
  293.  
  294.           for (int positionCounter = 0; positionCounter < 16; positionCounter++) {
  295.             lcd.scrollDisplayLeft();
  296.             delay(500);
  297.           }
  298.           break;
  299.         case 3:
  300.           for (int z = 0; z < 10; z++) {
  301.             lcd.display();
  302.             delay(500);
  303.             lcd.noDisplay();
  304.             delay(500);
  305.           }
  306.           lcd.display();
  307.           break;
  308.         case 4:
  309.           etatLEDRouge = !etatLEDRouge;
  310.           if (etatLEDRouge == true) {
  311.             digitalWrite(pinLEDRouge, HIGH);
  312.           } else {
  313.             digitalWrite(pinLEDRouge, LOW);
  314.           }
  315.           break;
  316.         case 5:
  317.           lcd.setCursor(0, 0);
  318.           lcd.print(F("  Telecommande  "));
  319.           lcd.setCursor(0, 1);
  320.           lcd.print(F("     a ZoLL     "));
  321.           break;
  322.         case 6:
  323.           etatLEDRougeModule = !etatLEDRougeModule;
  324.           if (etatLEDRougeModule == true) {
  325.             digitalWrite(pinLEDRougeModule, HIGH);
  326.           } else {
  327.             digitalWrite(pinLEDRougeModule, LOW);
  328.           }
  329.           break;
  330.         case 7:
  331.           etatLEDVertModule = !etatLEDVertModule;
  332.           if (etatLEDVertModule == true) {
  333.             digitalWrite(pinLEDVertModule, HIGH);
  334.           } else {
  335.             digitalWrite(pinLEDVertModule, LOW);
  336.           }
  337.           break;
  338.         case 8:
  339.           etatLEDJauneModule = !etatLEDJauneModule;
  340.           if (etatLEDJauneModule == true) {
  341.             digitalWrite(pinLEDJauneModule, HIGH);
  342.           } else {
  343.             digitalWrite(pinLEDJauneModule, LOW);
  344.           }
  345.           break;
  346.         case 9:
  347.           etatLEDBleuModule = !etatLEDBleuModule;
  348.           if (etatLEDBleuModule == true) {
  349.             digitalWrite(pinLEDBleuModule, HIGH);
  350.           } else {
  351.             digitalWrite(pinLEDBleuModule, LOW);
  352.           }
  353.           break;
  354.         case 10:
  355.           lcd.setCursor(0, 0);
  356.           lcd.print(F(" ARDUINO FRANCE "));
  357.           lcd.setCursor(0, 1);
  358.           lcd.print(F("MARSEILLE - 2020"));
  359.           for (int z = 0; z < 10; z++) {
  360.             r = random(255);
  361.             v = random(255);
  362.             b = random(255);
  363.             lcd.setRGB(r, v, b);
  364.             lcd.display();
  365.             delay(500);
  366.             lcd.noDisplay();
  367.             delay(500);
  368.           }
  369.           r = 255;
  370.           v = 204;
  371.           b = 0;
  372.           lcd.setRGB(r, v, b);
  373.           lcd.display();
  374.           break;
  375.         case 11:
  376.           if (r == 255 && v == 204 && b == 0) {
  377.             lcd.setCursor(0, 0);
  378.             lcd.print(F("      MODE      "));
  379.             lcd.setCursor(0, 1);
  380.             lcd.print(F("     VEILLE     "));
  381.             r = 1;
  382.             v = 1;
  383.             b = 1;
  384.           } else {
  385.             //afficheResultats (monBufferValeur, monBufferNom);
  386.             r = 255;
  387.             v = 204;
  388.             b = 0;
  389.           }
  390.           break;
  391.         case 12:
  392.           ancienR = 255;
  393.           ancienV = 204;
  394.           ancienB = 0;
  395.           if (rotationCouleur < 4) {
  396.             rotationCouleur ++;
  397.           } else {
  398.             rotationCouleur = 0;
  399.           }
  400.           switch (rotationCouleur) {
  401.             case 0:
  402.               r = ancienR;
  403.               v = ancienV;
  404.               b = ancienB;
  405.               break;
  406.             case 1:
  407.               r = 255;
  408.               v = 0;
  409.               b = 0;
  410.               break;
  411.             case 2:
  412.               r = 0;
  413.               v = 255;
  414.               b = 0;
  415.               break;
  416.             case 3:
  417.               r = 0;
  418.               v = 0;
  419.               b = 255;
  420.               break;
  421.             case 4:
  422.               r = 255;
  423.               v = 255;
  424.               b = 255;
  425.               break;
  426.           }
  427.           lcd.print(F(" "));
  428.           lcd.print(rotationCouleur);
  429.           break;
  430.         case 13:
  431.           ancienR = 255;
  432.           ancienV = 204;
  433.           ancienB = 0;
  434.           if (rotationCouleur > 0) {
  435.             rotationCouleur --;
  436.           } else {
  437.             rotationCouleur = 4;
  438.           }
  439.           switch (rotationCouleur) {
  440.             case 0:
  441.               r = ancienR;
  442.               v = ancienV;
  443.               b = ancienB;
  444.               break;
  445.             case 1:
  446.               r = 255;
  447.               v = 0;
  448.               b = 0;
  449.               break;
  450.             case 2:
  451.               r = 0;
  452.               v = 255;
  453.               b = 0;
  454.               break;
  455.             case 3:
  456.               r = 0;
  457.               v = 0;
  458.               b = 255;
  459.               break;
  460.             case 4:
  461.               r = 255;
  462.               v = 255;
  463.               b = 255;
  464.               break;
  465.           }
  466.           lcd.print(F(" "));
  467.           lcd.print(rotationCouleur);
  468.           break;
  469.         case 14:
  470.           lcd.scrollDisplayLeft();
  471.           break;
  472.         case 15:
  473.           lcd.scrollDisplayRight();
  474.           break;
  475.         case 16:
  476.           etatLED = !etatLED;
  477.           etatLEDRouge = !etatLEDRouge;
  478.           if (etatLED == true) {
  479.             digitalWrite(pinLEDTemoin, HIGH);
  480.           } else {
  481.             digitalWrite(pinLEDTemoin, LOW);
  482.           }
  483.           if (etatLEDRouge == true) {
  484.             digitalWrite(pinLEDRouge, HIGH);
  485.           } else {
  486.             digitalWrite(pinLEDRouge, LOW);
  487.           }
  488.           break;
  489.         case 17:
  490.           for (int w = 0; w < 16; w++) {
  491.             lcd.setCursor(w, 0);
  492.             for (int x = 0; x < 2; x ++) {
  493.               lcd.cursor();
  494.               delay(250);
  495.               lcd.noCursor();
  496.               delay(125);
  497.             }
  498.           }
  499.           break;
  500.         case 18:
  501.           for (int y = 15; y >= 0; y--) {
  502.             lcd.setCursor(y, 1);
  503.             lcd.blink();
  504.             delay(1400);
  505.           }
  506.           lcd.stopBlink();
  507.           break;
  508.         case 19:
  509.           lcd.print(F(" "));
  510.           lcd.cursor();
  511.           break;
  512.         case 20:
  513.           lcd.print(F(" "));
  514.           lcd.blink();
  515.           break;
  516.         case 21:
  517.           if (r >= 10) {
  518.             r -= 10;
  519.           } else {
  520.             r = 0;
  521.           }
  522.           if (v >= 10) {
  523.             v -= 10;
  524.           } else {
  525.             v = 0;
  526.           }
  527.           if (b >= 10) {
  528.             b -= 10;
  529.           } else {
  530.             b = 0;
  531.           }
  532.           break;
  533.         case 22:
  534.           if ( v <= 245) {
  535.             r += 10;
  536.           } else {
  537.             r = 255;
  538.           }
  539.           if (v <= 245) {
  540.             v += 10;
  541.           } else {
  542.             v = 255;
  543.           }
  544.           if (b <= 245) {
  545.             b += 10;
  546.           } else {
  547.             b = 255;
  548.           }
  549.           break;
  550.         case 23:
  551.           for (int positionCounter = 0; positionCounter < 15; positionCounter++) {
  552.             lcd.scrollDisplayLeft();
  553.             delay(500);
  554.           }
  555.  
  556.           for (int positionCounter = 0; positionCounter < 31; positionCounter++) {
  557.             lcd.scrollDisplayRight();
  558.           }
  559.  
  560.           for (int positionCounter = 0; positionCounter < 16; positionCounter++) {
  561.             lcd.scrollDisplayLeft();
  562.             delay(500);
  563.           }
  564.           break;
  565.         case 24:
  566.  
  567.           for (int positionCounter = 0; positionCounter < 16; positionCounter++) {
  568.             lcd.scrollDisplayRight();
  569.             delay(500);
  570.           }
  571.  
  572.           for (int positionCounter = 0; positionCounter < 31; positionCounter++) {
  573.             lcd.scrollDisplayLeft();
  574.           }
  575.  
  576.           for (int positionCounter = 0; positionCounter < 15; positionCounter++) {
  577.             lcd.scrollDisplayRight();
  578.             delay(500);
  579.           }
  580.           break;
  581.         case 25:
  582.           r = 255;
  583.           v = 0;
  584.           b = 0;
  585.           break;
  586.         case 26:
  587.           r = 255;
  588.           v = 255;
  589.           b = 0;
  590.           break;
  591.         case 27:
  592.           r = 255;
  593.           v = 255;
  594.           b = 255;
  595.           break;
  596.         case 28:
  597.           r = 0;
  598.           v = 255;
  599.           b = 255;
  600.           break;
  601.         case 29:
  602.           r = 0;
  603.           v = 0;
  604.           b = 255;
  605.           break;
  606.         case 30:
  607.           r = 255;
  608.           v = 0;
  609.           b = 255;
  610.           break;
  611.         case 31:
  612.           r = 0;
  613.           v = 255;
  614.           b = 0;
  615.           break;
  616.         case 32:
  617.           r = random(255);
  618.           v = random(255);
  619.           b = random(255);
  620.           break;
  621.         case 33:
  622.           r = 125;
  623.           v = 125;
  624.           b = 125;
  625.           break;
  626.         case 34:
  627.           r = 5;
  628.           v = 5;
  629.           b = 5;
  630.           break;
  631.         case 35:
  632.           lcd.setCursor(0, 0);
  633.           lcd.print(F("https://pastebin.com/vcvNTAE8"));
  634.           lcd.setCursor(0, 1);
  635.           lcd.print(F(" 100 % libre de droits  2020 "));
  636.           for (int positionCounter = 0; positionCounter < 29; positionCounter++) {
  637.             lcd.scrollDisplayLeft();
  638.             delay(500);
  639.           }
  640.  
  641.           for (int positionCounter = 0; positionCounter < 45; positionCounter++) {
  642.             lcd.scrollDisplayRight();
  643.             delay(500);
  644.           }
  645.  
  646.           for (int positionCounter = 0; positionCounter < 16; positionCounter++) {
  647.             lcd.scrollDisplayLeft();
  648.             delay(500);
  649.           }
  650.           break;
  651.         case 36:
  652.           lcd.setCursor(0, 0);
  653.           lcd.print(F(" MERCI   =^..^= "));
  654.           lcd.setCursor(0, 1);
  655.           lcd.print(F("    TAI FOON    "));
  656.           break;
  657.       }
  658.     }
  659.     recepteurIR.resume();
  660.     delay(50);
  661.   }
  662.  
  663. }
Add Comment
Please, Sign In to add comment