updated both slave code to support bi-directional

Project Codes