Locking and unlocking PXT .hex files

QUESTION How can I protect a .hex file (e.g. a teaching resource) so the source code is not readable? I want to lock a .hex file so that students can’t see the contents. I want to give a .hex file to students that demonstrates a target to achieve, but in a way they cannot read the source code. How can I prevent ‘dragging and dropping’ a .hex file into the PXT editor from viewing the source code? BACKGROUND The PXT […]

Forever runs before OnStart finishes

PROBLEM My Forever loop starts before the OnStart has finished I get runtime error 40 or 42, (NULL reference) CAUSE Under the covers, the micro:bit will start every Forever loop in it’s own fiber (a fiber is a light-weight thread that can run independently from other fibers – a bit like a separate block of code in Scratch, for example). The On Start block will run to completion, then Forever blocks will start executing. However, if there are any pause […]

Using radio group codes with PXT

QUESTION How do the radio group codes work with PXT? I haven’t set a radio group, how does the micro:bit allocate group numbers? Radio not communicating with PXT. Radio not working in PXT. ANSWER The ‘radio’ blocks in PXT sit on top of the radio interface, that is surfaced from the Lancaster University DAL (Device Abstraction Layer). This Radio interface is based on a proprietary short range wireless interface provided in the Nordic nRF51 software development kit. The micro:bit runtime […]

Package approval

QUESTION Please can you approve my package? How do I get my package listed in the packages box? What is package “whitelisting”? ANSWER The PXT editor allows the publishing of packages. These packages can be loaded into another user’s script and used by them. They are really useful for publishing drivers for accessories or other useful pieces of hardware, as well as adding in new software features. Only packages on the ‘approved package list’ are visible to users directly in […]

Is it possible to program using visual blocks, using MicroPython

QUESTION Is there a way that learners can start in a more visual way with MicroPython? Is there a blocks/blocky interface for MicroPython Is there a visual coding interface for MicroPython ANSWER Yes, there is an ‘early alpha’ version here that people can experiment with. http://python.microbit.org/blocksalpha/0.1.0-blocksalpha/editor.html  

How do I install the latest Mu on Raspberry Pi

PROBLEM No module named speech No module named radio How do I use the speech feature on MicroPython How do I use the radio feature on MicroPython How do I get the latest version of Mu for Raspberry Pi CAUSE The version of Mu for the Raspberry Pi that gets installed when you use sudo apt-get install mu relies on a ‘person in the loop’ – i.e. a person elsewhere has to decide to update the central repository. The central […]

Why do I get an import error with speech and radio?

PROBLEM ImportError: no module named speech in MicroPython ImportError: no module named radio in MicroPython speech not working in MicroPython radio not working in MicroPython No speech in MicroPython on Raspberry Pi using Mu No radio in MicroPython on Raspberry Pi using Mu CAUSE The Python web hosted editor at microbit.co.uk is managed on a slower release cycle than other editors, and as such, it does not have the latest innovations built into it (like speech and radio) SOLUTION Use […]

Strange rounding error

PROBLEM When I use floating point numbers, I get a strange rounding problem. Why do I get lots of digits displayed in a number? Strange rounding problem in Python/MicroPython. Lots of digits displayed after a number. 18.9 gets displayed as 18.89999 CAUSE https://github.com/bbcmicrobit/micropython/issues/367#issuecomment-258059673 The microbit uses 30-bit floating point and 18.9 is parsed correctly/accurately but it’s then rounded down to 18.899999 when stored in 30 bits. Floating point numbers are always going to have inaccuracies and you should use formatting […]

Where do I start with Python on micro:bit

QUESTION I want to get started using Python on the micro:bit, where’s a good starting point? Are there any Python lessons for micro:bit? If I want to teach Python, where would I start? ANSWER 1. Click on the LETS CODE in our header… 2. Scroll down to the python section, and press the LESSONS button

All for Joomla All for Webmasters