fix
This commit is contained in:
parent
73b412318a
commit
ec0ec5c170
|
@ -25,7 +25,7 @@ void RATGDOComponent::setup() {
|
||||||
this->rollingCodeCounter = 0;
|
this->rollingCodeCounter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
swSerial.begin(9600, SWSERIAL_8N2, -1, OUTPUT_GDO, true);
|
this->swSerial.begin(9600, SWSERIAL_8N2, -1, OUTPUT_GDO, true);
|
||||||
pinMode(TRIGGER_OPEN, INPUT_PULLUP);
|
pinMode(TRIGGER_OPEN, INPUT_PULLUP);
|
||||||
pinMode(TRIGGER_CLOSE, INPUT_PULLUP);
|
pinMode(TRIGGER_CLOSE, INPUT_PULLUP);
|
||||||
pinMode(TRIGGER_LIGHT, INPUT_PULLUP);
|
pinMode(TRIGGER_LIGHT, INPUT_PULLUP);
|
||||||
|
@ -348,7 +348,7 @@ void RATGDOComponent::transmit(byte *payload, unsigned int length) {
|
||||||
digitalWrite(OUTPUT_GDO, LOW); // bring the line low
|
digitalWrite(OUTPUT_GDO, LOW); // bring the line low
|
||||||
|
|
||||||
delayMicroseconds(1260); // "LOW" pulse duration before the message start
|
delayMicroseconds(1260); // "LOW" pulse duration before the message start
|
||||||
swSerial.write(payload, length);
|
this->swSerial.write(payload, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RATGDOComponent::sync() {
|
void RATGDOComponent::sync() {
|
||||||
|
|
|
@ -44,7 +44,6 @@ extern unsigned int rollingCodeCounter;
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace ratgdo {
|
namespace ratgdo {
|
||||||
|
|
||||||
SoftwareSerial swSerial;
|
|
||||||
|
|
||||||
|
|
||||||
class RATGDOComponent; // this component
|
class RATGDOComponent; // this component
|
||||||
|
@ -56,6 +55,7 @@ class RATGDOComponent : public Component {
|
||||||
/********************************** GLOBAL VARS
|
/********************************** GLOBAL VARS
|
||||||
* *****************************************/
|
* *****************************************/
|
||||||
unsigned int rollingCodeCounter;
|
unsigned int rollingCodeCounter;
|
||||||
|
SoftwareSerial swSerial;
|
||||||
byte rollingCode[CODE_LENGTH];
|
byte rollingCode[CODE_LENGTH];
|
||||||
String doorState =
|
String doorState =
|
||||||
"unknown"; // will be
|
"unknown"; // will be
|
||||||
|
|
Loading…
Reference in New Issue