Guest User

Untitled

a guest
Feb 17th, 2017
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. #include <IRremote.h>
  2.  
  3. const char DIN_RECEPTEUR_INFRAROUGE = 11;
  4.  
  5. IRrecv monRecepteurInfraRouge (DIN_RECEPTEUR_INFRAROUGE);
  6.  
  7. decode_results messageRecu;
  8.  
  9. int RED = 10;
  10. int GREEN = 9;
  11. int BLUE = 8;
  12.  
  13. void setup()
  14. {
  15. Serial.begin(9600);
  16. monRecepteurInfraRouge.enableIRIn();
  17. monRecepteurInfraRouge.blink13(true);
  18. pinMode(RED, OUTPUT);
  19. pinMode(GREEN, OUTPUT);
  20. pinMode(BLUE, OUTPUT);
  21. }
  22.  
  23. void loop() {
  24.  
  25. if (monRecepteurInfraRouge.decode(&messageRecu))
  26. {
  27. if (messageRecu.value == 0xFFE21D)
  28. {Serial.println("CH+");}
  29. if (messageRecu.value == 0xFFA25D)
  30. {Serial.println("CH-");}
  31. if (messageRecu.value == 0xFF629D)
  32. {Serial.println("CH");}
  33. if (messageRecu.value == 0xFF22DD)
  34. {Serial.println("<<");}
  35. if (messageRecu.value == 0xFF02FD)
  36. {Serial.println(">>");}
  37. if (messageRecu.value == 0xFFC23D)
  38. {Serial.println(">||");}
  39. if (messageRecu.value == 0xFFE01F)
  40. {Serial.println("-");}
  41. if (messageRecu.value == 0xFFA857)
  42. {Serial.println("+");}
  43. if (messageRecu.value == 0xFF906F)
  44. {Serial.println("EQ");}
  45. if (messageRecu.value == 0xFF6897)
  46. {Serial.println("0");}
  47. if (messageRecu.value == 0xFF9867)
  48. {Serial.println("100+");}
  49. if (messageRecu.value == 0xFFB04F)
  50. {Serial.println("200+");}
  51. if (messageRecu.value == 0xFF30CF)
  52. {Serial.println("1");}
  53. if (messageRecu.value == 0xFF18E7)
  54. {Serial.println("2");}
  55. if (messageRecu.value == 0xFF7A85)
  56. {Serial.println("3");}
  57. if (messageRecu.value == 0xFF10EF)
  58. {Serial.println("4");}
  59. if (messageRecu.value == 0xFF38C7)
  60. {Serial.println("5");}
  61. if (messageRecu.value == 0xFF5AA5)
  62. {Serial.println("6");}
  63. if (messageRecu.value == 0xFF42BD)
  64. {Serial.println("7");}
  65. if (messageRecu.value == 0xFF4AB5)
  66. {Serial.println("8");}
  67. if (messageRecu.value == 0xFF52AD)
  68. {Serial.println("9");}
  69. delay(500);
  70. monRecepteurInfraRouge.resume();
  71. }
  72. delay(1);
  73. }
  74.  
  75. void setColor(int red, int green, int blue)
  76. {
  77. #ifdef COMMON_ANODE
  78. red = 255 - red;
  79. green = 255 - green;
  80. blue = 255 - blue;
  81. #endif
  82. analogWrite(RED, red);
  83. analogWrite(GREEN, green);
  84. analogWrite(BLUE, blue);
  85. }
Advertisement
Add Comment
Please, Sign In to add comment