Skip to content

Instantly share code, notes, and snippets.

@philaretexls
Created January 6, 2015 16:36
Show Gist options
  • Save philaretexls/bff2b25fe25ab4457032 to your computer and use it in GitHub Desktop.
Save philaretexls/bff2b25fe25ab4457032 to your computer and use it in GitHub Desktop.
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