Advertisement
safwan092

Untitled

Oct 22nd, 2023
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <RCSwitch.h>
  2.  
  3. RCSwitch mySwitch = RCSwitch();
  4.  
  5. void setup() {
  6.  
  7. Serial.begin(9600);
  8.  
  9. // Transmitter is connected to Arduino Pin #10
  10. mySwitch.enableTransmit(10);
  11.  
  12. // Optional set pulse length.
  13. mySwitch.setPulseLength(321);
  14.  
  15. // set protocol (default is 1, will work for most outlets)
  16. // mySwitch.setProtocol(2);
  17.  
  18. // Optional set number of transmission repetitions.
  19. // mySwitch.setRepeatTransmit(15);
  20.  
  21. pinMode(13,OUTPUT);
  22.  
  23. }
  24.  
  25. void loop() {
  26. mySwitch.send("100000101100100011001000");
  27. digitalWrite(13,HIGH);
  28. delay(500);
  29. digitalWrite(13,LOW);
  30. delay(1000);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement