diff --git a/PZEM004T.cpp b/PZEM004T.cpp index 09cea29..b54f7c6 100644 --- a/PZEM004T.cpp +++ b/PZEM004T.cpp @@ -27,7 +27,7 @@ PZEM004T::PZEM004T(uint8_t receivePin, uint8_t transmitPin) { SoftwareSerial *swserial = new SoftwareSerial(receivePin, transmitPin); - port->begin(PZEM_BAUD_RATE); + swserial->begin(PZEM_BAUD_RATE); this->serial = swserial; this->_isSoft = true; }