parallel port programming using Python?
mlinnen at usa.net
Mon Nov 1 22:46:01 EST 1999
Most of my robotic projects have revolved around 8 bit microcontrolers and
various languages like Basic, Forth and assembly. I was always running into
problems like lack of floating point arithmetic, or running out of memory.
So I recently moved to Windows 98 platform on a laptop with Visual Basic as
the language. The laptop would communicate through the RS232 port to a slave
computer. The slave computer handled all the time specific stuff like PWM
to the motors, collision avoidance ect.. Visual Basic was used for the high
I wanted to try some Object Oriented techniques and I ran across Python.
Since it is an interpreted language I thought it would be easy to prototype
new ideas. So far it has worked very well for me. I do not have a full robot
functioning with Linux and Python yet, but I did write some C code to access
a Vector 2X compass on the parallel port. I then extended the Python
language with my new V2X module. I used the demo/extend/xxmodule.C as an
example for my module. Now I can simply import my new module inside Python
and read the direction my robot is facing with a couple of commands. All
the high level mapping/ navigational planning can be done with Python. This
seems like a cool way to go as far as I am concerned. Modeling Behaviors in
Python using OOP would be really neat. Extending the robots functionality
should become easier also.
I am not a real C programmer myself but I was able to port my Visual Basic
V2X code over to C fairly easy. I got it working on a Linux box without
Python first. Then I merged Python and my working C code together.
Currently I am researching what Single Board Computer will best suit my
needs. I will be using Linux, Python, and C together to achieve almost all
of my I/O. I suspect I might have to go to RTLINUX to achieve this.
I am also interested in your progress with Linux and your Bot. I have only
used DC motors and PWM myself but have thought of going to steppers for more
Mark Ricketts <mricket2 at ford.com> wrote in message
news:7vc1tg$5477 at eccws12.dearborn.ford.com...
> I'm kind of a novice when it comes to c programming, I've used basic on
> pc but since I'm acquaninting myself with linux I figured the best way to
> learn a new language is to attempt an actual useful project. I'd like to
> build a little xyz robot using stepper motors for motion control that will
> be operated via the parallel port. I've already got the thing working in
> the DOS/Windows world, but I am so into the whole linux philosophy that I
> want to redo it using Python in Linux. Python is said to be a very easy
> language to pick-up but so far I haven't found any language routines that
> will allow me to access the parallel port for this type of control. So
> I'm very interested in what you are doing, maybe you could expand on what
> your project is all about, and how it's progressing.
> msdr at sprint.ca
> Mike Linnen <mlinnen at usa.net> wrote in message
> news:KimO3.9837$pL5.20871 at news.rdc1.az.home.com...
> > I am in the process of rolling my own extension to python that allows
> > parrallel port access. If you know C it is not to hard to extend
> > functionallity.
> > Mark Rickets <markr at tfz.net> wrote in message
> > news:19991014.22042400 at mis.configured.host...
> > I want to use python for data acquisition from the parallel port. I
> > am using Mandrake-Linux as the operating system on a PC if that makes
> > a difference. Are there any modules available in Python that allow
> > one to access the system parallel port for this type of function?
> > msdr at sprint.ca
More information about the Python-list