title: Arduino - Detect external power
body: <p>I have an external power source (6v) that is connected to a motor and a servo, and on my arduino board I have a couple of LEDs which are powered by the onboard 5v. The external power is connected to a switch so I can turn on the motor and servo (to save battery). My main board just blinks the different LEDs. What I want to happen is that the moment my external power is switched on, the LEDs stop blinking and the code to move the servo and motor is executed. As a result I have a boolean called <code>intro</code>. When it is true, the LED code executes, when it is false the motor and servo code will execute. The only problem I am having is that how can the Arduino know if the external power is switched on so that the boolean can be set to false? Is there a way that the arduino can detect if the external power is on (for example checking the pins of the motor/servo?)?</p>