This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Turn Off All Ports When One Motor Disconnect

Hi Everyone,

I am trying to improve my coding skill. Here is my scenario:

I have four ports which connected to four DC motor. The default state of the ports is set to '0'. I change the ports state to '1' for turning on all the motors. When I disconnect one of the Motors from their port, one motor will be off because I disconnect it. But the other three are still running. How do I know if my ports is connected to any device such as DC motors? Can anyone show a sample code?

Thanks!

Regards,
Sharil