digital ouput via usb or serial port

1 次查看(过去 30 天)
RISHABJEET
RISHABJEET 2011-3-31
GUYZ PLEASE HELP.... I NEED TO GIVE DIGITAL OUTPUT OF A MICROCONTROLLER ON PC. FOR THIS CONNECTED A SERIAL RS232 PORT WHITH A USB CONNECTOR.
NOW HOW DO I GET IT????

回答(1 个)

Walter Roberson
Walter Roberson 2011-3-31
If you need to read from a serial port, the use serial() to create a serial port object and set some of its attributes, use set() to set more extended attributes for handling the port, and fopen() the port. If the fopen works, the fread() or fgetl() or fgets() from the port will input values from the serial port. The number of bytes ready to read at any one time will be the BytesAvailable property of the serial port object. You might want to set up a BytesAvailableFcn callback to be triggered when a given number of bytes appears or when the input detects a callback.

类别

Help CenterFile Exchange 中查找有关 Simultaneous and Synchronized Operations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by