Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <RCSwitch.h>
- RCSwitch mySwitch = RCSwitch();
- void setup() {
- Serial.begin(9600);
- // Transmitter is connected to Arduino Pin #10
- mySwitch.enableTransmit(10);
- // Optional set pulse length.
- mySwitch.setPulseLength(321);
- // set protocol (default is 1, will work for most outlets)
- // mySwitch.setProtocol(2);
- // Optional set number of transmission repetitions.
- // mySwitch.setRepeatTransmit(15);
- pinMode(13,OUTPUT);
- }
- void loop() {
- mySwitch.send("100000101100100011001000");
- digitalWrite(13,HIGH);
- delay(500);
- digitalWrite(13,LOW);
- delay(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement