Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Reading serial port data into a file

by jmlynesjr (Pilgrim)
on Jun 04, 2013 at 20:57 UTC ( #1037055=note: print w/ replies, xml ) Need Help??


in reply to Reading serial port data into a file

Look at Device::SerialPort, Device::SerialPort::Arduino, or Win32::SerialPort if on windows.

James

There's never enough time to do it right, but always enough time to do it over...


Comment on Re: Reading serial port data into a file
Re^2: Reading serial port data into a file
by Anonymous Monk on Jun 04, 2013 at 22:33 UTC

    Look at Device::SerialPort, Device::SerialPort::Arduino, or Win32::SerialPort if on windows.

    :) serialport isn't usb , are you sure about that?

      Yes. Have used Device::SerialPort::Arduino to read data coming from the USB interface on the chipKIT UNO PIC based Arduino clone. The chipKIT UNO uses the FTDI FT232R USB serial converter chip and FTDI FT232R drivers are available on my Unbuntu 10.10 laptop. This is a pretty commonly used USB support chip.

      # Perl Polling Test # Title: Perl to chipKIT Serial Poll Test # Author: James M. Lynes, Jr. # Version: 1.0 # Creation Date: June 10, 2012 # Modification Date: June 10, 2012 use strict; use warnings; # Initialize the serial port - creates the serial port object $Arduino use Device::SerialPort::Arduino; my $Arduino = Device::SerialPort::Arduino->new( port => '/dev/ttyUSB0', baudrate => 9600, databits => 8, parity => 'none', ); while(1) { $Arduino->communicate('P'); # Send a poll print ($Arduino->receive(), "\n"); # Print poll respons +e sleep(1); # Delay until next p +oll }

      James

      There's never enough time to do it right, but always enough time to do it over...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1037055]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2014-08-23 01:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (169 votes), past polls