I know about 4 wires in a USB !i want to work on them i.e. data+ & data-, ground, power ! i use windows7.
i want to control the signals (may it be binary of digital) through the wires using c ! i want to drive a car with the 4 arrow keys on my keyboard !
the main idea is to connect the 4 wires of a USB to the remote controller of the car and when we press any arrow key the on/off signal will be sent to the specific wire indeed ill make connection in such a way that when i press forward the remote controller gets forward command and transmittes to the car which makes it move !
basically i am ready with every other thing other than connecting the usb to c program and directing it in a specific command
i want 6 commands to work;
please help !1!this stuff is killing me !
USB ports on modern computers cannot be manipulated directly in the manner that you are describing, because the processor is not accessing those wires directly. There is a dedicated host controller chip that does most of the job, usually one implementing one of the various Host Controller Interface specifications. That chip handles the low-level handshaking with the various devices and may just refuse to work with a port that does not have a proper USB device connected.
The main CPU accesses the USB port by programming the host controller, which imposes several restrictions on what can and cannot be done. In addition, all major operating systems that I am aware off have a pretty rigid interface for accessing USB ports. Even if the HCI allowed direct signal manipulation of the USB port, the OS interface does not.
Finally, wiring random non-USB-compliant hardware to the USB port is a very good way to fry the port and possibly the computer. USB is intended to be implemented by both the computer and the device.
If you want to control hardware with the USB port, then you could either use an adapter to another port interface (e.g. a parallel port) or incorporate a microcontroller that supports USB connectivity in your car controller.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With