473,287 Members | 3,319 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Robotics and parallel ports

Basically, I'm thinking about building a robot which can be controlled by
programs which I write, I'm going to interface to the robot through the
parallel port (like in this tutorial here:
linuxfocus.org/English/May2001/article205.shtml). However, I know that this
will probably need to be done in low level C. Now, although I can code in
C, I don't particularly want to :-) , instead I'd like to use Python. I'm
wondering, is there any way I can access the parallel port and the kernel
module parport using Python?

Many thanks.

Regards,

--
sleepingeliminator
Dec 15 '05 #1
11 3818
Isaac T Alston wrote:
I'm wondering, is there any way I can access the parallel port and
the kernel module parport using Python?


A quick Google search for "parport python" turned up this:

http://bigasterisk.com/parallel

Maybe it's what you're looking for.

--- Heiko.
Dec 15 '05 #2
Isaac T Alston wrote:
I'm wondering, is there any way I can access the parallel port and
the kernel module parport using Python?


Or you might even give pyparallel a try:

http://pyserial.sourceforge.net/pyparallel.html

I've used that before to control a psychology experiment setup, and it works
just fine, under Linux and under Windows.

--- Heiko.
Dec 15 '05 #3
Heiko Wundram wrote:
Maybe it's what you're looking for.


Thanks for that. I've never actually built a robot or anything like that
before, so I'm welcome to any advice I can get! I've heard programming via
USB is hard, so that's why I'm using the parallel port (serial ports are
said to be slow when sending a lot of data (I think)). I think I'll start
off with something very simple, for example controlling a motor and then
move up to more advance models.

Thanks again.

Regards,

--
Isaac
Dec 15 '05 #4
Hi Isaac,

I've been meaning to get into robot building too. After much
consideration I decided to go the Lego Mindstorms route. I actually
figured it was a Pythonic way to go. "Pythonic" meaning finding
something that lets me do I want easily with minimal knowledge of the
system required. (I'm pretty sure it won't actually run Python)

I figure eventually I'll graduate to working on raw electronics like
you, but working with Mindstorms will let me figure out what I'm
interested in and determine what limitations it has.

I'll let you know how my approach goes. I'm figuring I'll get the
Mindstorms for Christmas .. otherwise I'll buy one soon after.

Do drop me an email sometime. I'm very interested to see how you
progress in your approach.

-Greg
On 12/15/05, Isaac T Alston <sl****************@gmail.com> wrote:
Heiko Wundram wrote:
Maybe it's what you're looking for.


Thanks for that. I've never actually built a robot or anything like that
before, so I'm welcome to any advice I can get! I've heard programming via
USB is hard, so that's why I'm using the parallel port (serial ports are
said to be slow when sending a lot of data (I think)). I think I'll start
off with something very simple, for example controlling a motor and then
move up to more advance models.

Thanks again.

Regards,

--
Isaac
--
http://mail.python.org/mailman/listinfo/python-list

--
Gregory Piñero
Chief Innovation Officer
Blended Technologies
(www.blendedtechnologies.com)
Dec 15 '05 #5

Isaac T Alston wrote:
Heiko Wundram wrote:
Maybe it's what you're looking for.
Thanks for that. I've never actually built a robot or anything like that
before, so I'm welcome to any advice I can get! I've heard programming via
USB is hard, so that's why I'm using the parallel port (serial ports are
said to be slow when sending a lot of data (I think)). I think I'll start
off with something very simple, for example controlling a motor


I did that using the Lego Mindstorm Robotics Kit:

<http://members.aol.com/rotanasnem/lego.htm>
and then move up to more advance models.
I never got past the

Turn the motor on
Halt

design.

Thanks again.

Regards,

--
Isaac


Dec 15 '05 #6
Isaac T Alston (sl****************@gmail.com) wrote:
: Heiko Wundram wrote:
: > Maybe it's what you're looking for.

: Thanks for that. I've never actually built a robot or anything like that
: before, so I'm welcome to any advice I can get! I've heard programming via
: USB is hard, so that's why I'm using the parallel port (serial ports are
: said to be slow when sending a lot of data (I think)). I think I'll start
: off with something very simple, for example controlling a motor and then
: move up to more advance models.

Greetings Isaac,

Go for it! Words of advice on using the parallel port:

1 - there are different modes (SPP, EPP etc.) availible - 'Parallel Port
Interfacing' on www.beyondlogic.org is an excellent starting point. The
mode is set in the PC BIOS, and if it's not set to the mode you're coding
for then you may spend hours being perplexed...

2 - If you're new to robotics etc. make sure you think carefully about
how you connect your motors to the parallel port to prevent hardware
getting blown... An old but good book that covers electronic (and
computer) control of motors is "The Robot Builder's Bonanza"

Seperatly: USB needn't be so hard... This little board of tricks
http://www.dlpdesign.com/usb/usb245.shtml gives you a parallel interface
from USB 1.1, and a C library on the PC (which can be accessed from
Python with ctypes) - data rate is similar to the parallel port, although
latency is much higher, which can kill performance of some applications.

Enjoy!
Dec 15 '05 #7
Isaac T Alston wrote:
I've never actually built a robot or anything like that
before, so I'm welcome to any advice I can get! I've heard programming via
USB is hard, so that's why I'm using the parallel port (serial ports are
said to be slow when sending a lot of data (I think)).


How much data do you plan to send? We build industrial control systems
and robotics for laboratories and use serial ports most of the time
without much concern for performance. Generally speaking you shouldn't
have to send lots of data, and only rare have to receive lots (e.g. if
you have a camera on-board).

The only time I'd consider a parallel port is in the very early stages
if I had no intelligence in the robot, and simply needed a few discrete
output signals to turn motors on and off. In a prototype, for example.
For anything real I would likely have on-board intelligence (embedded
Linux system maybe, or a microcontroller board) and in that case a
serial port is going to be much easier to work with than a parallel port.

-Peter

Dec 16 '05 #8
Thanks for everyone's tips and hints. I WILL MAKE THIS WORK! I think I'll
take your advice and use the serial port instead of the parallel port - I
won't have that much data to send (in comparison with, for example,
industrial level applications). As for on-board chips though, does this
require low level programming!? Or can I have an embedded python
interpreter for the chip?

Many thanks.

Regards,

--
Isaac
Dec 16 '05 #9
Hi,
Thank you for the info.
The dlp usb solution looks like a terrific gadget, especially since
parallel ports have almost disppeared, at least on portables.
In fact, would in linux not any py software capable of dealing with a
usb connection (almost) suffice? Any further comments would be much
appreciated.
malv

Dec 16 '05 #10
Isaac T Alston (sl****************@gmail.com) wrote:
: Thanks for everyone's tips and hints. I WILL MAKE THIS WORK! I think I'll
: take your advice and use the serial port instead of the parallel port - I
: won't have that much data to send (in comparison with, for example,
: industrial level applications). As for on-board chips though, does this
: require low level programming!? Or can I have an embedded python
: interpreter for the chip?

Hi Isaac,
You might be interested in PyMite - http://python.fyxm.net/pycon/papers/pymite/
although I don't know much (anythin? :-) about it.

For on board control there are some tiny embedded computers out there that can run
Linux etc. (and hence Python) these days - e.g. see
http://www.linuxdevices.com/articles/AT8498487406.html or you could use a much simpler
processor such as a PIC to implement a simple serial port to dgital and analogue IO
module.

Either way, plent to do :-)

Cheers,
cds
Dec 17 '05 #11
Thanks - now I just have to convince my parents that I should be allowed to
etch circuit boards in my room :-) .

Thanks again.

Regards,

Isaac
Dec 19 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Diego Solis | last post by:
Hi people, I need to write a C# program which communicates with a thermal printer. After a search for the web I found that a way to comunicate with the ports is calling the kernel32.dll, which...
2
by: SearedIce | last post by:
Where should I start in my search for information about how to do this? I have always wanted to learn and I think I finally have the initiative. Any C++ library files for doing this? Thank...
11
by: karan | last post by:
I would like to know how one can use the parallel port through c/c++.Also, how does one determine what port is installed(EPP/ECP/SSP/PS2)? What is the differnece between these? What are the...
3
by: Dave | last post by:
Im just starting in vb6 and want to write a scanning program, but iam being flumoxed by the use of and access to parallel ports. Can anyone help? please Thanks Dave
11
by: Timothy Smith | last post by:
hello people. i've been trying to send an 8 byte string to my parallel port under freebsd. the purpose is it to control a relay board. the board simply responds to the output byte coming from...
0
by: Yungsid | last post by:
Hi I am currently involved in a project. It involves using a pc's parallel port to control a circuit. I was using c-sharp before but I got stuck using the hinstance lib. So if you could give me a...
1
by: yanz | last post by:
Hi everyone. Hope you guys can help me. Attached below are VB6 codes for a hand phone to call to a modem. When the action is executed, a message box will pop out ‘Ring Ring’. I just want to know is...
2
by: joaquimfpinto | last post by:
Dear All, I made an app in c# that uses several serial ports. For the serial ports I use a pnp Sunix board, some with 8 serial ports other with 4 or even 2 serial ports. Whenever I use the...
4
by: Soren | last post by:
Hi, I want to control some motors using the parallel port.. however, my laptop does not have any parallel ports (very few do). What I do have is a USB->Parallel converter... I thought about...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.