<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Are the GPIOs SLOW?]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">Im porting a project from Arduino to Omega2. The code runs fine in Arduino.</p>
<p dir="auto">As a test, I wrote a simple C code to toggle a couple GPIOs as shown for Omega2</p>
<pre><code> while(1) {
   digitalWrite(PWM_LEFT_PIN,0);
   digitalWrite(PWM_RIGHT_PIN,1);
   usleep(5);
   digitalWrite(PWM_LEFT_PIN,1);
   digitalWrite(PWM_RIGHT_PIN,0);
   usleep(5);
 }
</code></pre>
<p dir="auto">The low level code im using to control the ports is here, called inside digitalWrite()</p>
<p dir="auto"><a href="https://github.com/Patryk27/omega2-gpio" rel="nofollow">https://github.com/Patryk27/omega2-gpio</a></p>
<p dir="auto">My test code should toggle the port every 5 micro seconds, however when i put it on the scope its closer to 75 microseconds.</p>
<p dir="auto">Am I doing something wrong?</p>
<p dir="auto">maybe the uSleep is causing it?</p>
<p dir="auto">Anybody has Idea?</p>
<p dir="auto">Thanks</p>
]]></description><link>http://community.onion.io/topic/4914/are-the-gpios-slow</link><generator>RSS for Node</generator><lastBuildDate>Fri, 16 Oct 2026 08:52:29 GMT</lastBuildDate><atom:link href="http://community.onion.io/topic/4914.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 30 Nov 2022 14:16:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Are the GPIOs SLOW? on Wed, 30 Nov 2022 14:16:04 GMT]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">Im porting a project from Arduino to Omega2. The code runs fine in Arduino.</p>
<p dir="auto">As a test, I wrote a simple C code to toggle a couple GPIOs as shown for Omega2</p>
<pre><code> while(1) {
   digitalWrite(PWM_LEFT_PIN,0);
   digitalWrite(PWM_RIGHT_PIN,1);
   usleep(5);
   digitalWrite(PWM_LEFT_PIN,1);
   digitalWrite(PWM_RIGHT_PIN,0);
   usleep(5);
 }
</code></pre>
<p dir="auto">The low level code im using to control the ports is here, called inside digitalWrite()</p>
<p dir="auto"><a href="https://github.com/Patryk27/omega2-gpio" rel="nofollow">https://github.com/Patryk27/omega2-gpio</a></p>
<p dir="auto">My test code should toggle the port every 5 micro seconds, however when i put it on the scope its closer to 75 microseconds.</p>
<p dir="auto">Am I doing something wrong?</p>
<p dir="auto">maybe the uSleep is causing it?</p>
<p dir="auto">Anybody has Idea?</p>
<p dir="auto">Thanks</p>
]]></description><link>http://community.onion.io/post/25030</link><guid isPermaLink="true">http://community.onion.io/post/25030</guid><dc:creator><![CDATA[nsmith]]></dc:creator><pubDate>Wed, 30 Nov 2022 14:16:04 GMT</pubDate></item><item><title><![CDATA[Reply to Are the GPIOs SLOW? on Wed, 30 Nov 2022 21:41:59 GMT]]></title><description><![CDATA[<p dir="auto">Can you profile <code>digitalWrite</code> function only?<br />
Like this,</p>
<pre><code class="language-c"> while(1) {
   digitalWrite(PWM_LEFT_PIN,0);
   digitalWrite(PWM_LEFT_PIN,1);
 }
</code></pre>
<p dir="auto">With this code, what's  the wavelength of output signal on <code>LEFT_PIN</code> ?</p>
]]></description><link>http://community.onion.io/post/25034</link><guid isPermaLink="true">http://community.onion.io/post/25034</guid><dc:creator><![CDATA[DumTux]]></dc:creator><pubDate>Wed, 30 Nov 2022 21:41:59 GMT</pubDate></item></channel></rss>