<?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[Simple button example]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I am new to this platform. I have some experience with the Arduino, so that's why I want to compare the two boards a bit.</p>
<ol>
<li>Could someone explain if it is possible and if yes, how to do this example on the Lopy?<br />
<a href="https://www.arduino.cc/en/tutorial/button" target="_blank" rel="noopener noreferrer nofollow">https://www.arduino.cc/en/tutorial/button</a></li>
<li>Or this simple example?<br />
<a href="https://www.arduino.cc/en/tutorial/pushbutton" target="_blank" rel="noopener noreferrer nofollow">https://www.arduino.cc/en/tutorial/pushbutton</a></li>
<li>On Arduino I can also connect a led with a resistor to an output port to turn it on and off, can I also do this with the Lopy?</li>
</ol>
<p dir="auto">Thanks,<br />
Mark</p>
]]></description><link>https://forum.pycom.io/topic/1028/simple-button-example</link><generator>RSS for Node</generator><lastBuildDate>Wed, 10 Jun 2026 12:10:56 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/1028.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 14 Apr 2017 07:24:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Simple button example on Fri, 14 Apr 2017 07:24:01 GMT]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I am new to this platform. I have some experience with the Arduino, so that's why I want to compare the two boards a bit.</p>
<ol>
<li>Could someone explain if it is possible and if yes, how to do this example on the Lopy?<br />
<a href="https://www.arduino.cc/en/tutorial/button" target="_blank" rel="noopener noreferrer nofollow">https://www.arduino.cc/en/tutorial/button</a></li>
<li>Or this simple example?<br />
<a href="https://www.arduino.cc/en/tutorial/pushbutton" target="_blank" rel="noopener noreferrer nofollow">https://www.arduino.cc/en/tutorial/pushbutton</a></li>
<li>On Arduino I can also connect a led with a resistor to an output port to turn it on and off, can I also do this with the Lopy?</li>
</ol>
<p dir="auto">Thanks,<br />
Mark</p>
]]></description><link>https://forum.pycom.io/post/6383</link><guid isPermaLink="true">https://forum.pycom.io/post/6383</guid><dc:creator><![CDATA[markj]]></dc:creator><pubDate>Fri, 14 Apr 2017 07:24:01 GMT</pubDate></item><item><title><![CDATA[Reply to Simple button example on Fri, 14 Apr 2017 07:41:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1241">@markj</a><br />
the wire is &quot;the same&quot; but you must remember about 3V3 voltage to use not 5V.</p>
<p dir="auto">and code for button is really simple:</p>
<pre><code>from machine import Pin
button_ext_pull = Pin('P18', mode=Pin.IN, pull=None)
button_int_pull = Pin('P19', mode=Pin.IN, pull=Pin.PULL_UP)
</code></pre>
<p dir="auto"><code>button_ext_pull</code> is with external pullup resistor<br />
<code>button_int_pull</code> is with internall pullup resistor</p>
]]></description><link>https://forum.pycom.io/post/6385</link><guid isPermaLink="true">https://forum.pycom.io/post/6385</guid><dc:creator><![CDATA[livius]]></dc:creator><pubDate>Fri, 14 Apr 2017 07:41:25 GMT</pubDate></item><item><title><![CDATA[Reply to Simple button example on Fri, 14 Apr 2017 10:41:23 GMT]]></title><description><![CDATA[<p dir="auto">Thank you for your response.</p>
<p dir="auto">Have you tried the examples on the Lopy?<br />
And does the internal led work the same way as for Arduino?<br />
Pin high and the led goes on?</p>
<p dir="auto">Datasheet mentions 6 mA recommended, while most leds are already more than 20 mA. So I thought examples with external leds were not possible?</p>
]]></description><link>https://forum.pycom.io/post/6395</link><guid isPermaLink="true">https://forum.pycom.io/post/6395</guid><dc:creator><![CDATA[markj]]></dc:creator><pubDate>Fri, 14 Apr 2017 10:41:23 GMT</pubDate></item><item><title><![CDATA[Reply to Simple button example on Fri, 14 Apr 2017 18:43:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1241">@markj</a><br />
you can test external led, but you must add resistor e.g. 620ohm</p>
]]></description><link>https://forum.pycom.io/post/6408</link><guid isPermaLink="true">https://forum.pycom.io/post/6408</guid><dc:creator><![CDATA[livius]]></dc:creator><pubDate>Fri, 14 Apr 2017 18:43:34 GMT</pubDate></item><item><title><![CDATA[Reply to Simple button example on Fri, 14 Apr 2017 20:02:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/199">@livius</a> Thanks livius, but it is still not very clear to me. Hopefully you can answer these questions:</p>
<ol>
<li>
<p dir="auto">So it is correct you can only draw 12 mA current? Will the board break if you pull more?</p>
</li>
<li>
<p dir="auto">Can we control the led by writing a value to the pin (e.g. P2 High turns on the led)?</p>
</li>
<li>
<p dir="auto">I = (3.3 - 1.9) / 620 = 0.002 A, I doubt the led will light on?</p>
</li>
</ol>
]]></description><link>https://forum.pycom.io/post/6415</link><guid isPermaLink="true">https://forum.pycom.io/post/6415</guid><dc:creator><![CDATA[markj]]></dc:creator><pubDate>Fri, 14 Apr 2017 20:02:46 GMT</pubDate></item><item><title><![CDATA[Reply to Simple button example on Fri, 14 Apr 2017 20:15:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1241">@markj</a> hello mark. Yes, the chip or at least that port may break if you draw more than recommended. A LED will light up at any current, just the intensity is a little bit lower. 20mA are just a typical figure, not the minimal current, and that value is kind of aged.<br />
And yes, you can control the LED by writing a value to the port.<br />
By using the PWM class, you can control the brightness, just like Arduino analog_write(). Look here for an exmaple: <a href="https://docs.pycom.io/pycom_esp32/library/machine.PWM.html?highlight=pwm" target="_blank" rel="noopener noreferrer nofollow">https://docs.pycom.io/pycom_esp32/library/machine.PWM.html?highlight=pwm</a></p>
]]></description><link>https://forum.pycom.io/post/6416</link><guid isPermaLink="true">https://forum.pycom.io/post/6416</guid><dc:creator><![CDATA[robert-hh]]></dc:creator><pubDate>Fri, 14 Apr 2017 20:15:32 GMT</pubDate></item><item><title><![CDATA[Reply to Simple button example on Fri, 14 Apr 2017 20:29:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/98">@robert-hh</a> Thanks a lot Robert and Livius! I saw indeed the PWM example in the Micropython docs to dim a led.</p>
]]></description><link>https://forum.pycom.io/post/6418</link><guid isPermaLink="true">https://forum.pycom.io/post/6418</guid><dc:creator><![CDATA[markj]]></dc:creator><pubDate>Fri, 14 Apr 2017 20:29:20 GMT</pubDate></item></channel></rss>