…and the package will download from PyPI. If you wish to upgrade to the
latest version, use the following command:

$ pip install --no-cache --upgrade uflash

NB: You must use a USB data cable to connect the micro:bit to your
computer (some cables are power only). You’re in good shape if, when plugged
in, the micro:bit appears as a USB storage device on your file system.

Linux users: For uflash to work you must ensure the micro:bit is mounted as a
USB storage device. Usually this is done automatically. If not you’ve probably
configured automounting to be off. If that’s the case, we assume you
have the technical knowledge to mount the device yourself or to install the
required kernel modules if they’re missing. Default installs of popular Linux
distros “should just work” (tm) out of the box given a default install.

If you type the command on its own then uflash will attempt to find a connected
BBC micro:bit and flash an unmodified default version of the MicroPython
runtime onto it:

$ uflash
Flashing Python to: /media/ntoll/MICROBIT/micropython.hex

To flash a version of the MicroPython runtime with a specified script embedded
within it (so that script is run when the BBC micro:bit boots up) then pass
the path to the Python script in as the first argument to the command:

You can let uflash watch for changes of your script. It will be flashed
automatically every time you save it:

$ uflash -w my_script.py

or:

$ uflash --watch my_script.py

At this point uflash will try to automatically detect the path to the device.
However, if you have several devices plugged in and/or know what the path on
the filesystem to the BBC micro:bit already is, you can specify this as a
second argument to the command:

The source code is hosted in GitHub. Please feel free to fork the repository.
Assuming you have Git installed you can download the code from the canonical
repository with the following command:

$ git clone https://github.com/ntoll/uflash.git

Ensure you have the correct dependencies for development installed by creating
a virtualenv and running:

$ pip install -r requirements.txt

To locally install your development version of the module into a virtualenv,
run the following command:

$ python setup.py develop

There is a Makefile that helps with most of the common workflows associated
with development. Typing make on its own will list the options thus:

$ make
There is no default Makefile target right now. Try:
make clean - reset the project and remove auto-generated assets.
make pyflakes - run the PyFlakes code checker.
make pep8 - run the PEP8 style checker.
make test - run the test suite.
make coverage - view a report on test coverage.
make check - run all the checkers and tests.
make package - create a deployable package for the project.
make publish - publish the project to PyPI.
make docs - run sphinx to create project documentation.

Contributions are welcome without prejudice from anyone irrespective of
age, gender, religion, race or sexuality. If you’re thinking, “but they don’t
mean me”, then we especially mean YOU. Good quality code and engagement with
respect, humour and intelligence wins every time.

If you’re from a background which isn’t well-represented in most geeky groups, get involved - we want to help you make a difference.

If you’re from a background which is well-represented in most geeky groups, get involved - we want your help making a difference.

If you’re worried about not being technical enough, get involved - your fresh perspective will be invaluable.

If you think you’re an imposter, get involved.

If your day job isn’t code, get involved.

This isn’t a group of experts, just people. Get involved!

We are interested in educational, social and technical problems. If you are too, get involved.

This is a new community. No-one knows what they are doing, so, get involved.

Feedback may be given for contributions and, where necessary, changes will be
politely requested and discussed with the originating author. Respectful yet
robust argument is most welcome.

Finally, contributions are subject to the following caveat: the contribution
was created by the contributor who, by submitting the contribution, is
confirming that they have the authority to submit the contribution and place it
under the license as defined in the LICENSE file found within this repository.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.