Skip to content
Snippets Groups Projects
Commit 85ef3038 authored by s.oezguer's avatar s.oezguer
Browse files

undo r116

parent 5ef73d7e
No related branches found
No related tags found
No related merge requests found
...@@ -256,7 +256,6 @@ void RCSwitch::send(char* sCodeWord) { ...@@ -256,7 +256,6 @@ void RCSwitch::send(char* sCodeWord) {
i++; i++;
} }
this->sendSync(); this->sendSync();
} }
} }
...@@ -267,13 +266,10 @@ void RCSwitch::transmit(int nHighPulses, int nLowPulses) { ...@@ -267,13 +266,10 @@ void RCSwitch::transmit(int nHighPulses, int nLowPulses) {
if (this->nReceiverInterrupt != -1) { if (this->nReceiverInterrupt != -1) {
this->disableReceive(); this->disableReceive();
} }
digitalWrite(this->nTransmitterPin, LOW);
delayMicroseconds( this->nPulseLength * nHighPulses);
digitalWrite(this->nTransmitterPin, HIGH); digitalWrite(this->nTransmitterPin, HIGH);
delayMicroseconds( this->nPulseLength * nLowPulses); delayMicroseconds( this->nPulseLength * nHighPulses);
digitalWrite(this->nTransmitterPin, LOW); digitalWrite(this->nTransmitterPin, LOW);
delayMicroseconds( this->nPulseLength * nLowPulses);
if (nRec != -1) { if (nRec != -1) {
this->enableReceive(nRec, this->mCallback); this->enableReceive(nRec, this->mCallback);
} }
...@@ -286,7 +282,7 @@ void RCSwitch::transmit(int nHighPulses, int nLowPulses) { ...@@ -286,7 +282,7 @@ void RCSwitch::transmit(int nHighPulses, int nLowPulses) {
* Waveform: | |___ * Waveform: | |___
*/ */
void RCSwitch::send0() { void RCSwitch::send0() {
this->transmit(2,1); this->transmit(1,3);
} }
/** /**
...@@ -295,7 +291,7 @@ void RCSwitch::send0() { ...@@ -295,7 +291,7 @@ void RCSwitch::send0() {
* Waveform: | |_ * Waveform: | |_
*/ */
void RCSwitch::send1() { void RCSwitch::send1() {
this->transmit(1,2); this->transmit(3,1);
} }
...@@ -335,7 +331,7 @@ void RCSwitch::sendTF() { ...@@ -335,7 +331,7 @@ void RCSwitch::sendTF() {
* Waveform: | |_______________________________ * Waveform: | |_______________________________
*/ */
void RCSwitch::sendSync() { void RCSwitch::sendSync() {
this->transmit(22,1); this->transmit(1,31);
} }
/** /**
...@@ -380,9 +376,9 @@ void RCSwitch::receiveInterrupt() { ...@@ -380,9 +376,9 @@ void RCSwitch::receiveInterrupt() {
unsigned long delayTolerance = delay*0.3; unsigned long delayTolerance = delay*0.3;
for (int i = 1; i<changeCount ; i=i+2) { for (int i = 1; i<changeCount ; i=i+2) {
if (timings[i] > delay-delayTolerance && timings[i] < delay+delayTolerance && timings[i+1] > delay*2-delayTolerance && timings[i+1] < delay*2+delayTolerance) { if (timings[i] > delay-delayTolerance && timings[i] < delay+delayTolerance && timings[i+1] > delay*3-delayTolerance && timings[i+1] < delay*3+delayTolerance) {
code = code << 1; code = code << 1;
} else if (timings[i] > delay*2-delayTolerance && timings[i] < delay*+delayTolerance && timings[i+1] > delay-delayTolerance && timings[i+1] < delay+delayTolerance) { } else if (timings[i] > delay*3-delayTolerance && timings[i] < delay*+delayTolerance && timings[i+1] > delay-delayTolerance && timings[i+1] < delay+delayTolerance) {
code+=1; code+=1;
code = code << 1; code = code << 1;
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment