Open ThreepE0 opened 2 years ago
Noticed that in RCSwitch.cpp the pin mode is set when enableTransmit is called. Pin mode is not set on receive. I set the pin mode manually in my sketch uploaded to a Uno Wifi Rev 2 (using pin 3) and it started working great.
Noticed exists: void RCSwitch::enableTransmit(int nTransmitterPin) { this->nTransmitterPin = nTransmitterPin; pinMode(this->nTransmitterPin, OUTPUT); }
void RCSwitch::enableTransmit(int nTransmitterPin) { this->nTransmitterPin = nTransmitterPin; pinMode(this->nTransmitterPin, OUTPUT); }
Suggested addition in the enableReceive function: `void RCSwitch::enableReceive() { if (this->nReceiverInterrupt != -1) { RCSwitch::nReceivedValue = 0; RCSwitch::nReceivedBitlength = 0;
wiringPiISR(this->nReceiverInterrupt, INT_EDGE_BOTH, &handleInterrupt);
attachInterrupt(digitalPinToInterrupt(this->nReceiverInterrupt), handleInterrupt, CHANGE); pinMode(this->nTransmitterPin, INPUT);
}`
Sorry I do not know how to perform a pull request
Hi, I probably experiencing the same issue, can you please share you RCSwitch.cpp code via https://gist.github.com ?
Noticed that in RCSwitch.cpp the pin mode is set when enableTransmit is called. Pin mode is not set on receive. I set the pin mode manually in my sketch uploaded to a Uno Wifi Rev 2 (using pin 3) and it started working great.
Noticed exists:
void RCSwitch::enableTransmit(int nTransmitterPin) { this->nTransmitterPin = nTransmitterPin; pinMode(this->nTransmitterPin, OUTPUT); }
Suggested addition in the enableReceive function: `void RCSwitch::enableReceive() { if (this->nReceiverInterrupt != -1) { RCSwitch::nReceivedValue = 0; RCSwitch::nReceivedBitlength = 0;
if defined(RaspberryPi) // Raspberry Pi
else // Arduino
endif
}`
Sorry I do not know how to perform a pull request