C
C
Comedozw2017-12-04 18:45:32
USB
Comedozw, 2017-12-04 18:45:32

How to connect a button to a computer via usb?

There is a task of the following kind, there is a button without fixing (that is, either 1 or 0), you need to transfer this state via usb and process it in a c# program. There was an idea when pressing the button to close D + and power, and already with D + programmatically read a logical unit. The question is how to organize the hardware part correctly (is it enough that I will pull D + up to 5V), the software part (how to process the incoming signal, is it possible to implement it in c #, or will I have to create a separate driver and already exchange data with the application) . I can’t use MK, I need to make a button with minimal costs, since there will be a large number of them.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
Johnny Gat, 2017-12-05
@Comedozw

Nothing without MK. Oh, and also, you will need to write drivers for USB :)

D
d-stream, 2017-12-05
@d-stream

Most likely, until a certain device identifies itself within the usb protocols, manipulations with D will not be visible (no connected devices).
Therefore, it would be less bloody to cling to RS-232 (for example, for DTR or DSR / TR)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question