Download the following 4 files:
Copy the last three files to a directory where your matlab can access.
Your LPT port number is probably 0x378 (or 888). Assume lptport is the port number, then we use lptread to read from the port:
val = lptread(lptport)
and use lptwrite to write to the port
As a real example, we want to control the step motor Gary created to investigate motion artifact in fMRI. Here is a sample code:
lptport = hex2dec('378'); dir = hex2dec('40'); data = hex2dec('20'); for ii=1:30 lptwrite(lptport, data+dir); pause(0.005) lptwrite(lptport, dir) pause(0.005) end
Author of lptread.m: Erik Flister, UCSD, 2006. Adapted from Andreas Widmann.