Replies
Welcome, guest
Join CrazyEngineers to reply, ask questions, and participate in conversations.
CrazyEngineers powered by Jatra Community Platform
-
@Ash • Dec 4, 2010
Hey shahrul,
I'm assuming the USB-UART converter is a serial port emulator. In Matlab, you just need to create a serial port object, open it, then read the data. At the most simple, the code will be:
s = serial('COM1'); % Create serial port object s set(s,'BaudRate',9600) fopen(s); %open port x = fscanf(s); % read data into variable x fclose(s) % close port delete(s) clear sThe above code assumes you are using COM1 port for the USB serial emulator. You should change accordingly. Also, 8N1 parameter is used as default. Of course, you may need to code more according to your project, refer to the Matlab reference below:
#-Link-Snipped-# -
shahrul OP
@shahrul-Ex12xz • Dec 5, 2010
Thanks, I will try.