From 07b4b5b783f1587bf8ffb526ff2468d5db150ade Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Fri, 5 Jun 2020 14:00:09 +0200 Subject: [PATCH] doc/start_pup: instructions for permanent program --- doc/api/start_pup.rst | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/doc/api/start_pup.rst b/doc/api/start_pup.rst index cd97407..770f710 100644 --- a/doc/api/start_pup.rst +++ b/doc/api/start_pup.rst @@ -12,6 +12,52 @@ Installing the Pybricks Firmware +Running Programs +-------------------------------- + + + +Advanced: Saving a Program on the Hub +-------------------------------------- + +When you run a program as shown above, it is deleted as soon as it's done. +That's because Powered Up hubs don't have a file system to store +programs. Fortunately, you can still save a script on the hub by including it +in the firmware. + +Of course, this is a bit slow to do every time. We recommend the +using the standard procedure most of the time. +When you're happy with your final program, you can save it permanently as +described below. To change the program, just repeat these steps. + +*Once installed, you can start that program with the green button. +No connection required!* + +.. todo:: + + **Coming soon! This will be made easy with the click of a button.** + + .. toggle-header:: + :header: **But I want it now! Show me the hard way!** + + **Installing a permanent program manually** + + The firmware is a ZIP archive containing the basic firmware and one + ``main.py`` script: + + 1. Go to the `latest builds`_. + 2. Click a build with a green checkmark. + 3. Download ZIP archive for your hub. + 4. Modify the ``main.py`` file as you like. + 5. Drag your modified ZIP file *onto* the firmware update button. + 6. The update now proceeds as usual. + 7. When it's done, start your program with the green button! + +Note: all LEGO motors and sensors need a few seconds to boot. You don't +normally notice because you spend that time connecting. But with the +program already installed, you're way faster. So if you experience +problems, give your hub a few seconds before you start your program. + Restoring the LEGO Firmware --------------------------- @@ -20,3 +66,4 @@ Restoring the LEGO Firmware +.. _latest builds: https://github.com/pybricks/pybricks-micropython/actions?query=workflow%3ABuild+