Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set your subtitle preferences in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please refer to our video player troubleshooting guide for assistance.

File Transfer - Workflow

00:00 File Transfer. The wide range of MicroPython implementations means that their behavior when plugged into a computer also varies. While this may appear trivial, it’s worth being aware of the potential variations that you may experience when using different hardware. Here, you will see the differences when using macOS, but the function of the MicroPython boards will be the same regardless of what operating system you’re using.

00:27 MicroPython and CircuitPython. Plugging in most MicroPython devices, as well as CircuitPython devices, will present the board’s flash memory as a USB flash drive.

00:42 It’s possible to manage files directly on the board using the operating system’s tools and to edit files directly.

00:51 Altering the file on a Pyboard will lead that code to be run the next time the board is rebooted. On a CircuitPython device, it’s that gets run. In the case of the Pyboard, if a microSD card is plugged into the board when it’s connected, it will be that SD card that’s presented to the operating system instead, as you can see here. That makes sense, as the default behavior of the Pyboard is to run from the SD card if one is present.

01:22 It also means that you can use the Pyboard as an SD card reader if you really need to, but it will be slow, as the Pyboard has to do all the file transfer work itself without dedicated hardware to speed up the work.

01:38 Micro:Bit. When connecting a Micro:Bit to the system, it also presents itself to the OS as a USB flash drive. However, there are two points to note here. Firstly, any files you copy to the Micro:Bit will disappear after you reset the device, so it can’t be used to store any resources.

02:02 Here, you can see a file being copied and pasted onto the Micro:Bit…

02:08 but disconnecting and reconnecting it…

02:14 shows that the file has now disappeared. Secondly, dragging a Python file to the device will not get it to run that program. The Micro:Bit will only ingest a compiled program in .hex format.

02:27 You’ll see how to do this later in the course. In short, while the Micro:Bit does appear as a USB drive, it doesn’t follow the norms you might expect from it, and this can limit its usefulness.

02:42 ESP-based Systems. Plugging an ESP-based board into the system will not show any storage device by default. If you’re used to the MicroPython way of working, then you’ll have to look at alternatives and in my experience, I’ve found that working on the M5StickC has been best done in an IDE, as you’ll see in the next section.

Become a Member to join the conversation.