guerda
guerda

Reputation: 24049

Which easy programming language to use for parallel port programming under Linux?

My father would like to use Ubuntu for LPT programming (via a relay card). He is used to QBasic and PowerBasic but willing to learn a new (simple) language for his goals.

What recommendations can you give me for this task?

Python would be my favourite if the module pyParallel worked. If there are other modules available for Python, let me know.

I cannot change the hardware, it's a requirement to only change software.

Thanks in advance for any hints!

Upvotes: 1

Views: 2541

Answers (4)

guerda
guerda

Reputation: 24049

The Python module pyParallel works. I had tried the release last time. Yesterday I used the HEAD revision and it works.

For somebody trying to do the same procedure:

  1. Download & install the HEAD revision of pyParallel.
  2. Unload the kernel module lp and load ppdev. It lets you access the parallel port device file.
  3. a) Add your OS user to the group lp so it has write access to /dev/parport*.
    b) Otherwise execute this: # chmod a+rw /dev/parport*
  4. Hack your program!

Steps 2., 3. b) and 4. must repeated every reboot. The blacklisting does not work properly (yet).
You can create a udev rule for the parport device file so that every user has write access to it.

Update: The blacklist now works. It was a bug in Ubuntu 9.04 with CUPS. In 9.10 it works perfectly.

Happy hacking!

Upvotes: 2

Phill Pafford
Phill Pafford

Reputation: 85298

An alternative might be Arduino, it has it's own IDE and can interface with tons of languages as well as run on all platforms. It's more of a hobbyists thing but might work out for you.

Upvotes: 0

grigy
grigy

Reputation: 6826

The Python is not easier than Basic. But I think for parallel port and other hardware programming C is a natural choice. It's not that hard to learn and it's worth to spend some time learning C.

Upvotes: 1

hova
hova

Reputation: 2841

http://www.mono-project.com/Visual_Basic He'll at least be familiar with the language, but accessing the parallel port is a more complicated task. I know there is a way, but all the samples online deal with windows libraries.

Upvotes: 1

Related Questions