Sorry, it seems difficult to explain something so simple in my mind. Sorry for maybe misleading explanation.
I do have a motor.
The code (from circuit.io) is this:
// Include Libraries
// Pin Definitions
#define DCMOTOR_PIN_COIL1 5
// Global variables and defines
// object initialization
dcMotor.on(200); // 1. turns on
delay(4000); // 2. waits 4000 milliseconds (4 sec). change the value in the brackets (4000) for a longer or shorter delay.
dcMotor.off(); // 3. turns off
delay(4000); // 4. waits 4000 milliseconds (4 sec). change the value in the brackets (4000) for a longer or shorter delay.
So. This is my Motor. I want CODE to do the following:
- Check if Motor Available
2 If Motor Available: Run Motor
- If Motor NOT Availalbe: Print Error
So we take as granted that everything is working well!
But maybe in time there is some damage in wires (for example) or a disconnection in power wire.
In step 1 I want to check if there is any wiring damage and Motor is not responding.
My question is “How can I do this check?”. In case some wires are damaged how can I know it (without physical presence)? Just from coding or maybe with some extra wiring.
I hope this time it is more helpfull.