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.
main.py file on a Pyboard will lead that code to be run the next time the board is rebooted. On a CircuitPython device, it’s
code.py 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
main.py 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: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.