Have you ever wondered how you can use and access parallel port using
Matlab. This post give a very easy and basic method of accessing and
using Parallel port using Matlab. But first of all lets learn a bit
about Parallel port.
This
is a typical type of port you usually find in the back of your PC.
Other external port such as USB or serial port requires more complex
sending and data receiving algorithms. But by using 8 data pins in
parallel port you can easily send a byte of data. That's why Parallel
Port is the most commonly used port for interfacing home made projects. Here is a good tutorial about parallel port configurations.
Now lets learn to access Parallel port using Matlab for your project.
You can easily access parallel port in Matlab
paraport=digitalio('parallel','LPT1');
by this u create a digital i/o object
line1=addline(paraport,0:3,'out');
this tells matlab to use first 4 data pins as output pin
pval=[0 0 0 1];
putvalue(paraport,pval);
this sends 1 value 2 pinno- 2.
Parallel port configuration
A typical Parallel port
Now lets learn to access Parallel port using Matlab for your project.
You can easily access parallel port in Matlab
paraport=digitalio('parallel','LPT1');
by this u create a digital i/o object
line1=addline(paraport,0:3,'out');
this tells matlab to use first 4 data pins as output pin
pval=[0 0 0 1];
putvalue(paraport,pval);
this sends 1 value 2 pinno- 2.
0 comments:
Post a Comment