Created
January 6, 2015 16:36
-
-
Save philaretexls/bff2b25fe25ab4457032 to your computer and use it in GitHub Desktop.
This file contains 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
Hi, | |
working code (g++ -c -o send.o send.cpp OR put this code into send.cpp file from RPIUtils and 'make'): | |
/*start*/ | |
#include <stdio.h> | |
int main(int argc, char *argv[]) { | |
int PIN = 0; | |
int systemCode = atoi(argv[1]); | |
if (wiringPiSetup () == -1) return 1; | |
RCSwitch rf_cmd = RCSwitch(); | |
rf_cmd.enableTransmit(0); | |
rf_cmd.setProtocol(2); | |
rf_cmd.setRepeatTransmit(15); | |
rf_cmd.setPulseLength(700); | |
rf_cmd.send(systemCode, 32); | |
} | |
/*end*/ | |
You can use it sending ex: sudo ./send 012345098 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment