Answer the question
In order to leave comments, you need to log in
How to output 5v from a computer?
Good afternoon, please tell me, can I output 5v from usb using any program or code?
Answer the question
In order to leave comments, you need to log in
No, you won’t get by with just one program, you will need more hardware.
The fact is that the PC is not able to programmatically control the presence of power on the USB lines, it is always there (in some cases, even when the PC is turned off).
As iron, you can use a simple circuit from a converter based on FT323 or CP2103 and a transistor.
It will be possible to control the on / off by changing the state of the DTR line using a simple program.
In most computers, 5V to USB is present all the time and is not controlled in any way. If you need to control something like on or off, then you can take the "Scroll Lock" signal from the keyboard - it can be changed from any program and the code will be universal for any PC.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question