Skip to content

HowTo_OperateLowCostOutlets

Max Horn edited this page Jan 5, 2016 · 11 revisions

What kind of switch

There are generally three common kinds of outlet switches. The first one is configured with a 10 pole DIP switch the other one is configured with two rotary (or sliding) switches with four setting possibilities each.

Type A: 10 pole DIP switches

images/typeA.png

RCSwitch::switchOn("11001", "01000");

The first parameter represents the setting of the first 5 DIP switches. In this example it's ON-ON-OFF-OFF-ON.

The second parameter represents the setting of the last 5 DIP switches. In this example the last 5 DIP switches are OFF-ON-OFF-OFF-OFF.

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {

  // Transmitter is connected to Arduino Pin #10  
  mySwitch.enableTransmit(10);
  
}

void loop() {

  mySwitch.switchOn("11001", "01000");

  // Wait a second
  delay(1000);
  
  // Switch off
  mySwitch.switchOff("11001", "01000");
  
  // Wait another second
  delay(1000);
  
}

Type B: Two rotary/sliding switches

images/typeB.png

RCSwitch::switchOn(4, 2);

The first parameter represents the setting of the first rotary switch. In this example it's switched to "4" or "D" or "IV".

The second parameter represents the setting of the second rotary switch. In this example it's switched to "2" or "B" or "II".

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {

  // Transmitter is connected to Arduino Pin #10  
  mySwitch.enableTransmit(10);
  
}

void loop() {

  mySwitch.switchOn(4, 2);

  // Wait a second
  delay(1000);
  
  // Switch off
  mySwitch.switchOff(4, 2);
  
  // Wait another second
  delay(1000);
  
}

Type C: Intertechno

RCSwitch::switchOn('a', 1, 2);

Clone this wiki locally