how we can send data to USB port

Answers (1)

Walter Roberson
Walter Roberson on 31 Mar 2014
That is not possible. USB consists of a controller device, and devices plugged into it. Only the controller can directly access any particular physical connector. How to send data to a device connected by USB depends on what class of device the plugged-in device tells the USB controller it is.

4 Comments

thanks for reply to Me, I like send number 1 2 3 4 5 to Usb port but I can not know Matlab Code.
You cannot send data to a USB port. The USB controller does not allow it. The port is under the complete control of the controller.
I suspect that what you want to do is send data to a virtual serial port that is connected by USB. If so then you use serial() to designate the name of the USB port you want to work with, and you use fopen() on the virtual serial port, and then you use fprintf() or fwrite() to send data to the virtual serial port.
@ Walter
LOL! You should write in Chines! Like I do
داداش، ب حضرت عباس نمیشه

Sign in to comment.

Categories

Find more on MATLAB in Help Center and File Exchange

Asked:

on 31 Mar 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!