diff --git a/RPi_utils/codesend.cpp b/RPi_utils/codesend.cpp index afed6fc..e538b8f 100644 --- a/RPi_utils/codesend.cpp +++ b/RPi_utils/codesend.cpp @@ -47,8 +47,8 @@ int main(int argc, char *argv[]) { if (wiringPiSetup () == -1) return 1; printf("sending code[%i]\n", code); RCSwitch mySwitch = RCSwitch(); - if (protocol != 0) mySwitch.setProtocol(protocol); if (pulseLength != 0) mySwitch.setPulseLength(pulseLength); + if (protocol != 0) mySwitch.setProtocol(protocol); mySwitch.enableTransmit(PIN); mySwitch.send(code, 24);