https://github.com/benoitberanger/parport_cenir
Parallel port source code written in C for MATLAB/Octave in Linux. To be compiled in mex.
https://github.com/benoitberanger/parport_cenir
c db25 linux matlab mex octave parallel-port
Last synced: 27 days ago
JSON representation
Parallel port source code written in C for MATLAB/Octave in Linux. To be compiled in mex.
- Host: GitHub
- URL: https://github.com/benoitberanger/parport_cenir
- Owner: benoitberanger
- License: apache-2.0
- Created: 2016-05-09T16:02:56.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-01-05T17:47:55.000Z (over 8 years ago)
- Last Synced: 2025-02-13T01:25:34.921Z (over 1 year ago)
- Topics: c, db25, linux, matlab, mex, octave, parallel-port
- Language: C
- Homepage:
- Size: 28.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Parallel port source code written in C for MATLAB/Octave in **Linux**. To be compiled in mex.
Purpose
-------
When compiled (see below), this program `ppmex` allows you to send messages through the parallel port (DB25) on a Linux system,
via MATLAB or Octave.
Test if you can compile MEX files
---------------------------------
In [helloworld-test-compile-mex](helloworld-test-compile-mex) subdir, you will find [helloworldMEX.c](helloworld-test-compile-mex/helloworldMEX.c).
When, in MATLAB/Octave, you are in this folder, enter `mex -O helloworldMEX.c`.
If the compilation is complet, you should have a new file such as *helloworldMEX.mex**
Compilation
-----------
When you have tested the compilation process (see above), simply type `mex -O -v ppmex.c` in the root dir.
The _warning_ about the line #21 `extern int pport = 0;` is nothing to worry about.
When completed, a file *ppmex.mex** should have been created.
Usage
-----
```
ppmex('open') : opens the device, and get it ready to send messages
ppmex('write',message) : sends the message = {0, 1, 2, ..., 255} uint8
ppmex('close') : closes the device
```