Shop OBEX P1 Docs P2 Docs Learn Events
PSC Python interface — Parallax Forums

PSC Python interface

hackman127hackman127 Posts: 34
edited 2006-03-01 15:11 in General Discussion
Everyone,

The project I am working on is written in Python, so I wrote a class to interface with the PSC. It currently has basic functionality for setting servo positions and ramp, and also retrieving both servo positions and the hardware version number. I am sure it will go through a few modifications and enhancements, but if you are looking for a way to use Python to interface with your PSC, this may be a good starting point. The code is cross platform, so you can use it in Windows and Unix variants (Linux/BSD). All platforms require pySerial, and Windows requires pywin32. Instructions for use and installation are detailed in the source. You can download the file here:
http://adamthree.com/index.php?page=files


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Luke

The perversity of nature is nowhere better demonstrated by the fact that, when
exposed to the same atmosphere, bread becomes hard while crackers become soft.

Comments

  • hackman127hackman127 Posts: 34
    edited 2006-02-28 21:57
    I see a few guys have downloaded the source for this. I was just wondering if any of you had any input on the interface. Any ideas or feature requests.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Luke

    The perversity of nature is nowhere better demonstrated by the fact that, when
    exposed to the same atmosphere, bread becomes hard while crackers become soft.
  • steve_bsteve_b Posts: 1,563
    edited 2006-03-01 03:00
    Sorry...slightly off topic.

    Is Python a C-based programming language? How easy is it to learn?
    Any resources?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • hackman127hackman127 Posts: 34
    edited 2006-03-01 15:11
    steve_b said...
    Sorry...slightly off topic.

    Is Python a C-based programming language? How easy is it to learn?
    Any resources?

    Steve,

    Not a problem. Python is not a C based language, although you can extend it in C. If Python cannot do something that you need to do, you can build a module in C to handle it. It can also be considered to be a scripting language and can be used for virtually anything. You can make it talk to Window managers, work with Apache to power dynamic web pages, and even make 2D/3D games with it. If you can learn C, Python should be a piece of cake.

    You can get more information at http://www.python.org/, and click on the "(docs)" link next to "Python 2.4" on the menu to the left. In the docs you will find all kinds of information from Tutorials to Library references. If you can't find what you need there, you can join the IRC channel #python·on FreeNode.net and ask the gurus.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Luke

    The perversity of nature is nowhere better demonstrated by the fact that, when
    exposed to the same atmosphere, bread becomes hard while crackers become soft.
Sign In or Register to comment.