Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Example for different sending methods
- http://code.google.com/p/rc-switch/
- */
- #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(320);
- // Optional set protocol (default is 1, will work for most outlets)
- // mySwitch.setProtocol(2);
- // Optional set number of transmission repetitions.
- mySwitch.setRepeatTransmit(10);
- }
- void loop() {
- Serial.println("off");
- mySwitch.send(20, 24);
- delay(2000);
- Serial.println("on");
- mySwitch.send(21, 24);
- delay(2000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement