Just a small module that generates a KAKU signal.
//
// Tiny Door Transmitter by @TOM at aquapoeder.nl
// https://www.hackster.io/Tom_van_Loon/tiny-door-sensor-1-e9d338
//
// https://creativecommons.org/licenses/by-nc-sa/2.0/
//
// Sources ;
//
// Nathan Chantell
// https://nathan.chantrell.net/20130215/tinytx3-wireless-sensor-board/
//
// Suat Özgür
// https://github.com/sui77/rc-switch/
//
const int DO = 0; // For sending to the Transmitter
const int LED = 1; // For indication of trigger
const int CS = 2; // For selecting the Transmitter
const int IN = 3; // Default LOW
int buttonState = 0;
#include <RCSwitch.h>;
RCSwitch mySwitch = RCSwitch();
void setup() {
pinMode(DO, OUTPUT);
pinMode(LED, OUTPUT);
pinMode(CS, OUTPUT);
pinMode(IN, INPUT);
mySwitch.enableTransmit(DO); // Equels PB0
void loop() {
buttonState = digitalRead(IN);
if (buttonState == HIGH) {
digitalWrite(CS, HIGH); // Broken chain / Alarm
delay(80);
mySwitch.send(4477265,24); // Elro 01010 B ON code ( Sending string 20817 )
delay(300);
digitalWrite(CS, LOW);
delay(80);
digitalWrite(LED, HIGH);
delay(8000);
digitalWrite(LED, LOW);
}
else {
digitalWrite(CS, HIGH);
delay(80);
mySwitch.send(4477268,24); // ( Sending string 20820 )
delay(300);
digitalWrite(CS, LOW);
delay(80);
} // END of if then
delay(23000);
}
Thanks to Nathan Chantrell and Suat Özgür.
Comments