diff --git a/src/DynamixelInterfaceArduinoImpl.cpp b/src/DynamixelInterfaceArduinoImpl.cpp index 9dc0cda..c218e3a 100644 --- a/src/DynamixelInterfaceArduinoImpl.cpp +++ b/src/DynamixelInterfaceArduinoImpl.cpp @@ -22,6 +22,8 @@ void DynamixelInterfaceImpl::readMode() if(mDirectionPin!=NO_DIR_PORT) { digitalWrite(mDirectionPin, LOW); + //enable listen() here: + setReadMode(mStream, mTxPin) } else { @@ -35,6 +37,8 @@ void DynamixelInterfaceImpl::writeMode() if(mDirectionPin!=NO_DIR_PORT) { digitalWrite(mDirectionPin, HIGH); + //disable listen() here: + setWriteMode(mStream, mTxPin); } else { @@ -43,7 +47,7 @@ void DynamixelInterfaceImpl::writeMode() } template -DynamixelInterfaceImpl::DynamixelInterfaceImpl(T &aStream, uint8_t aTxPin, uint8_t aDirectionPin=NO_DIR_PORT): +DynamixelInterfaceImpl::DynamixelInterfaceImpl(T &aStream, uint8_t aTxPin, uint8_t aDirectionPin): mStream(aStream), mDirectionPin(aDirectionPin), mTxPin(aTxPin) { if(mDirectionPin!=NO_DIR_PORT) diff --git a/src/DynamixelInterfaceArduinoImpl.h b/src/DynamixelInterfaceArduinoImpl.h index 436edc0..514d2c1 100644 --- a/src/DynamixelInterfaceArduinoImpl.h +++ b/src/DynamixelInterfaceArduinoImpl.h @@ -24,7 +24,7 @@ class DynamixelInterfaceImpl:public DynamixelInterface * \param[in] aTxPin : pin number of the tx pin * \param[in] aDirectionPin : direction pin, use NO_DIR_PORT if you do not use one (default) */ - DynamixelInterfaceImpl(T &aStream, uint8_t aTxPin, uint8_t aDirectionPin); + DynamixelInterfaceImpl(T &aStream, uint8_t aTxPin, uint8_t aDirectionPin=NO_DIR_PORT); /** * \brief Destructor