<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Connect to Serial Port Using Perl</title> <atom:link href="http://wanderingsamurai.net/programming-topics/connect-to-serial-port-using-perl/feed" rel="self" type="application/rss+xml" /><link>http://wanderingsamurai.net</link> <description>An Electron In A Sea Of Data</description> <lastBuildDate>Fri, 03 Feb 2012 19:31:08 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=</generator> <item><title>By: dmw</title><link>http://wanderingsamurai.net/programming-topics/connect-to-serial-port-using-perl/comment-page-1#comment-1519</link> <dc:creator>dmw</dc:creator> <pubDate>Thu, 17 Nov 2011 21:29:34 +0000</pubDate> <guid
isPermaLink="false">http://wanderingsamurai.net/?page_id=147#comment-1519</guid> <description>The example above will spin on cpu, reading as fast as the processor can cycle through the loop.# to effectively poll at .1 second intervals, try setting:
$port-&gt;read_char_time(0);
$port-&gt;read_const_time(100);# and in your while loop, don&#039;t have read do so much work, and only print if you have something to print:
while (1) {
my ($count,$bytes) = $port-&gt;read(255);
print &quot;$bytes&quot; if $count &gt; 0;
}</description> <content:encoded><![CDATA[<p>The example above will spin on cpu, reading as fast as the processor can cycle through the loop.</p><p># to effectively poll at .1 second intervals, try setting:<br
/> $port-&gt;read_char_time(0);<br
/> $port-&gt;read_const_time(100);</p><p># and in your while loop, don&#8217;t have read do so much work, and only print if you have something to print:<br
/> while (1) {<br
/> my ($count,$bytes) = $port-&gt;read(255);<br
/> print &#8220;$bytes&#8221; if $count &gt; 0;<br
/> }</p> ]]></content:encoded> </item> <item><title>By: dmw</title><link>http://wanderingsamurai.net/programming-topics/connect-to-serial-port-using-perl/comment-page-1#comment-1518</link> <dc:creator>dmw</dc:creator> <pubDate>Thu, 17 Nov 2011 21:27:37 +0000</pubDate> <guid
isPermaLink="false">http://wanderingsamurai.net/?page_id=147#comment-1518</guid> <description>Thanks for the simple example.  Couple of notes, though:The example above will spin on cpu, reading as fast as the processor can cycle through the loop.# to effectively poll at .1 second intervals, try setting:
$port-&gt;read_char_time(0);
$port-&gt;read_const_time(100);# and in your while loop, don&#039;t have read do so much work, and only print if you have something to print:
while (1) {
my ($count,$bytes) = $port-&gt;read(255);
print &quot;$bytes&quot; if $count &gt; 0;
}</description> <content:encoded><![CDATA[<p>Thanks for the simple example.  Couple of notes, though:</p><p>The example above will spin on cpu, reading as fast as the processor can cycle through the loop.</p><p># to effectively poll at .1 second intervals, try setting:<br
/> $port-&gt;read_char_time(0);<br
/> $port-&gt;read_const_time(100);</p><p># and in your while loop, don&#8217;t have read do so much work, and only print if you have something to print:<br
/> while (1) {<br
/> my ($count,$bytes) = $port-&gt;read(255);<br
/> print &#8220;$bytes&#8221; if $count &gt; 0;<br
/> }</p> ]]></content:encoded> </item> <item><title>By: Chris</title><link>http://wanderingsamurai.net/programming-topics/connect-to-serial-port-using-perl/comment-page-1#comment-177</link> <dc:creator>Chris</dc:creator> <pubDate>Tue, 18 Aug 2009 14:15:04 +0000</pubDate> <guid
isPermaLink="false">http://wanderingsamurai.net/?page_id=147#comment-177</guid> <description>Nice!  This is the first example that I&#039;ve tried that actually worked!  The main difference is that most sites have you usemy $byte = $port-&gt;lookfor();  #Which does not work!!!my $byte = $port-&gt;read(1); #works!!!Thanks!</description> <content:encoded><![CDATA[<p>Nice!  This is the first example that I&#8217;ve tried that actually worked!  The main difference is that most sites have you use</p><p>my $byte = $port-&gt;lookfor();  #Which does not work!!!</p><p>my $byte = $port-&gt;read(1); #works!!!</p><p>Thanks!</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 1/19 queries in 0.017 seconds using disk: basic
Object Caching 405/410 objects using disk: basic

Served from: wanderingsamurai.net @ 2012-02-06 23:04:17 -->
