/* dit bestand is gecopieerd van codesend. We willen de pulslengte van 680 erin zien te krijgen alsmede protocol2 */ #include "RCSwitch.h" #include #include int main(int argc, char *argv[]) { // This pin is not the first pin on the RPi GPIO header! // Consult https://projects.drogon.net/raspberry-pi/wiringpi/pins/ // for more information. pin0 is fysiek pin11 int PIN = 0; // Parse the firt parameter to this command as an integer int code = atoi(argv[1]); if (wiringPiSetup () == -1) return 1; printf("sending code[%i]\n", code); RCSwitch mySwitch = RCSwitch(); mySwitch.enableTransmit(PIN); mySwitch.setProtocol(2); //als we een pulslengte van 680 instellen dan meet ik telkens 693 //deze heb ik dus iets lager ingesteld, op 670 mySwitch.setPulseLength(670); mySwitch.send(code, 32); //32bits codes return 0; }