| 471 | } |
| 472 | |
| 473 | void RCSwitch::transmit(int nHighPulses, int nLowPulses) { |
| 474 | #if not defined ( RCSwitchDisableReceiving ) |
| 475 | boolean disabled_Receive = false; |
| 476 | int nReceiverInterrupt_backup = nReceiverInterrupt; |
| 477 | #endif |
| 478 | if (this->nTransmitterPin != -1) { |
| 479 | #if not defined( RCSwitchDisableReceiving ) |
| 480 | if (this->nReceiverInterrupt != -1) { |
| 481 | this->disableReceive(); |
| 482 | disabled_Receive = true; |
| 483 | } |
| 484 | #endif |
| 485 | digitalWrite(this->nTransmitterPin, HIGH); |
| 486 | delayMicroseconds( this->nPulseLength * nHighPulses); |
| 487 | digitalWrite(this->nTransmitterPin, LOW); |
| 488 | delayMicroseconds( this->nPulseLength * nLowPulses); |
| 489 | |
| 490 | #if not defined( RCSwitchDisableReceiving ) |
| 491 | if(disabled_Receive){ |
| 492 | this->enableReceive(nReceiverInterrupt_backup); |
| 493 | } |
| 494 | #endif |
| 495 | } |
| 496 | } |
| 497 | /** |
| 498 | * Sends a "0" Bit |
| 499 | * _ |