Skip to content

Instantly share code, notes, and snippets.

@dennisvandalen
Last active December 19, 2015 00:29
Show Gist options
  • Select an option

  • Save dennisvandalen/b1e6f0f9f04f810d68ba to your computer and use it in GitHub Desktop.

Select an option

Save dennisvandalen/b1e6f0f9f04f810d68ba to your computer and use it in GitHub Desktop.
Action (Impuls) 433MHz Remote Transmitter For Arduino, Turn on and off via Serial
// https://bitbucket.org/fuzzillogic/433mhzforarduino/wiki/Home
#include <RemoteTransmitter.h>
String incoming = ""; // for incoming serial data
ActionTransmitter actionTransmitter(11);
// pin 1,2,3,4 and 5 turned on
int receiver = 31;
char button = 'C';
void setup() {
Serial.begin(115200);
Serial.print("setting up .. ");
// maybe do some stuff
Serial.println("done!");
}
void loop() {
// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming string:
incoming = Serial.readString();
// say what you got:
Serial.print("I received: ");
Serial.println(incoming);
if(incoming == "on"){
// on
actionTransmitter.sendSignal(receiver, button, true);
} else if(incoming == "off"){
// off
actionTransmitter.sendSignal(receiver, button, false);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment