Perl is fine for hardware control as long as you aren't really speed-conscious. For dealing with serial I/O, I've used Device::SerialPort and Event. For dealing with the parallel port, you could use Inline. You don't say what OS platform you're on; if you're using Linux, you could use ioperm to gain access to the address ranges for the parallel port, or use /dev/parport. Under Win9x (DOS) you could use Inline directly to talk to the parallel port. Under NT, I'm not sure.

I wrote a module for dealing with external hardware through the I2C and/or SMBus (in my case, a smart battery and smart battery charger, but you could also get to CPU temperature sensors, serial A/D converters, etc.). Under Linux, there's already the i2c drivers and the lm-sensors project; if you use this, the bulk of the work is already done for you.

I also hacked one of the i2c-algo-bit device drivers to work with the Maxim SMBus interface card; if you're interested in this, /msg me.


In reply to Re: Perl to control hardware by bikeNomad
in thread Perl to control hardware by toma

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.