473,372 Members | 1,616 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,372 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 3822
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.