Could Yún turn on/off the power of the "Digital pin" with program?


I have a problem that i want to totally shut down the power of a device which is insert in Digital pin.

Is that possible to turn on/off the power of the "Digital pin" with program?


Can you please provide some more detail? What is the device, how much power does it require, how is it powered now? What connections does it need?

A digital pin can act as an input, in which case it can read the state of something, but it cannot control anything.

Or the digital pin can act as an output, in which case it can control something, but it doesn't have the ability to drive a lot of power (an LED or similar low power device is about the limit.)

If your device is very low power, it can get power directly from a digital pin that is set up as an output. You would set the output HIGH to turn it on, and LOW to turn it off. You would need other pins to control the device or get input from it.

If your device needs more than a few milliamps of power, then you will need to use a transistor or similar buffer -- it would be controlled by a digital output pin, and it in turn would control the power to the device.

But to give any more details we would need to know a lot more details about what you're trying to do.

use a relay ?