Uploaded from my local repository
[433Utils_NP] / rc-switch / examples / TypeA_WithDIPSwitches / TypeA_WithDIPSwitches.pde
1 /*
2   Example for outlets which are configured with a 10 pole DIP switch.
3   
4   https://github.com/sui77/rc-switch/
5 */
6
7 #include <RCSwitch.h>
8
9 RCSwitch mySwitch = RCSwitch();
10
11 void setup() {
12
13   // Transmitter is connected to Arduino Pin #10  
14   mySwitch.enableTransmit(10);
15
16   // Optional set pulse length.
17   // mySwitch.setPulseLength(320);
18   
19 }
20
21 void loop() {
22
23   // Switch on:
24   // The first parameter represents the setting of the first 5 DIP switches. 
25   // In this example it's ON-ON-OFF-OFF-ON.
26   // 
27   // The second parameter represents the setting of the last 5 DIP switches. 
28   // In this example the last 5 DIP switches are OFF-ON-OFF-ON-OFF.  
29   mySwitch.switchOn("11001", "01010");
30
31   // Wait a second
32   delay(1000);
33   
34   // Switch off
35   mySwitch.switchOff("11001", "01010");
36   
37   // Wait another second
38   delay(1000);
39   
40 }
Contact me: dev (at) shalnoff (dot) com
PGP fingerprint: A6B8 3B23 6013 F18A 0C71 198B 83D8 C64D 917A 5717