serial port servo control

Richard Brodie R.Brodie at rl.ac.uk
Thu Jun 22 11:30:21 EDT 2006


<boyle5 at llnl.gov> wrote in message 
news:1150989488.345731.49680 at m73g2000cwd.googlegroups.com...

> 1) How should I write to the serial port with python? I found the
> module "pyserial":

I don't think there is any need to hunt for anything better.

> In C I'd do this by sending 3 char's, as they're only 1 byte,
> but i'm not exactly sure how to do it in Python.

Use a string type. output = chr(x) + chr(y) + chr(z)  for example.
There is no restriction on null bytes in strings, so they are
appropriate for binary data. 





More information about the Python-list mailing list