Last active
December 19, 2015 00:29
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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