Support » Pololu 3pi+ 2040 User’s Guide » 5. Programming the 3pi+ with MicroPython »
5.2. Editing Python programs
<p>With MicroPython installed on the robot, you can edit files directly on the board in any text editor. To get started, open <code>blink.py</code> on the MicroPython drive:</p>
<table class="picture_with_caption center wide"><tr><td style="max-width: 600px"><a href="https://a.pololu-files.com/picture/0J12025.1200.png?54ebfa9f8edccca443512c40531d2085" class="noscript-fallback"><img alt="" class="wide zoomable" data-gallery-pictures="[{"id":"0J12025","caption":"\u003cp\u003eThe blink.py demo program in a text editor.\u003c/p\u003e","url_tiny":"https://a.pololu-files.com/picture/0J12025.98x98.jpg?54ebfa9f8edccca443512c40531d2085","url_medium":"https://a.pololu-files.com/picture/0J12025.600x480.jpg?54ebfa9f8edccca443512c40531d2085","url_full":"https://a.pololu-files.com/picture/0J12025.1200.png?54ebfa9f8edccca443512c40531d2085","longest_side":464}]" data-picture-id="0J12025" data-picture-longest_side="464" src="https://a.pololu-files.com/picture/0J12025.600.png?54ebfa9f8edccca443512c40531d2085" /></a></td><p></tr><tr><th style="max-width: 600px"><p>The blink.py demo program in a text editor.</p></th></tr></table></p>
<p>This program turns the LED on for 100 ms and off for 600 ms, repeating forever. You can run this program from the menu of demo programs as described in <a href="/docs/0J86/4">Section 4</a>. Make a small change to it, such as replacing the 600 with 100, save the file, and select <code>blink.py</code> from the menu again (you might need to reset the robot to get there.) It will run your updated program with the new blinking pattern.</p>
<p>Now, you can look around at the other files on the board, modify them, make new files, and run any of them from the menu. All of the original demo programs and other files are also available in <a href="https://github.com/pololu/pololu-3pi-2040-robot">our GitHub repository</a>.</p>
<div class="note_warning">
<p><strong>Note:</strong> when editing files directly on the board, keep in mind that it is easy to lose them in various ways:</p>
<ul>
<li>Resetting or disconnecting the board while saving a file</li>
<li>Editing files from within a MicroPython program and from your computer at the same time</li>
<li>Loading a new firmware file that erases all data</li>
<li>Software bugs or hardware failure</li>
</ul>
<p>To avoid losing work, we recommend saving backup copies periodically on your computer.</p>
</div>