libdo

Untitled

Sep 27th, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. include <IRremote.h>
  2.  
  3. int RECV_PIN = 11;
  4.  
  5. IRrecv irrecv(RECV_PIN);
  6.  
  7. decode_results results;
  8.  
  9. void setup()
  10. {
  11. Serial.begin(9600);
  12. irrecv.enableIRIn(); // Start the receiver
  13. pinMode(12,OUTPUT);//Pin For Led
  14. }
  15.  
  16. void loop() {
  17. if (irrecv.decode(&results)) {
  18. Serial.println(results.value,DEC);
  19. if(results.value==33427695)//<--Replace the new decimal value here
  20. {
  21. Serial.println("OK Pressed");
  22. if(digitalRead(12)==LOW)
  23. {digitalWrite(12,HIGH);
  24. }
  25. else{
  26. digitalWrite(12,LOW);
  27. }
  28. }
  29. irrecv.resume();
  30. }
  31. }
Add Comment
Please, Sign In to add comment