Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
rcswitch 433
// This #include statement was automatically added by the Particle IDE.
#include "RCSwitch/RCSwitch.h"
This is a minimal sketch without using the library at all but only works for
the 10 pole dip switch sockets. It saves a lot of memory and thus might be
very useful to use with ATTinys :)
int RCLpin = D7; // modified run with a Spark Core
void setup() {
pinMode(RCLpin, OUTPUT);
void loop() {
RCLswitch(0b010001000001); // DIPs at rc power outlet: 0100010000 ON:01
RCLswitch(0b010001000010); // DIPs at rc power outlet: 0100010000 OFF:10
void RCLswitch(uint16_t code) {
for (int nRepeat=0; nRepeat<6; nRepeat++) {
for (int i=4; i<16; i++) {
if (((code << (i-4)) & 2048) > 0) {
} else {
void RCLtransmit(int nHighPulses, int nLowPulses) {
digitalWrite(RCLpin, HIGH);
delayMicroseconds( 350 * nHighPulses);
digitalWrite(RCLpin, LOW);
delayMicroseconds( 350 * nLowPulses);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment