MicroPython Cookbook
上QQ阅读APP看书,第一时间看更新

How to do it...

Let's have a look at how to do this:

  1. Open the REPL through your preferred application.
  2. Download the latest CircuitPython Library Bundle release (https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/latest). The name of the bundle file is adafruit-circuitpython-bundle-3.x-mpy-20190212.zip. Since our firmware is using the 3.x release, we must select the bundle that is also for the 3.x release. Always use the mpy version, as this is optimized to use less disk space and has reduced memory usage.
We are using the latest auto-release version of the CircuitPython Library Bundle in this recipe, which is version 20190212 of the 3.x series.
  1. Extract the .zip file to a location on your computer.
  2. If the CIRCUITPY drive does not contain a lib folder, then create one now.
  3. Copy the contents of the extracted lib folder into the lib folder on the device.
  4. Perform a soft reboot in the REPL by pressing Ctrl + D.
  5. Run import simpleio in the REPL.
  6. If it has executed successfully, then the libraries have been successfully loaded, as the simpleio module is not part of the firmware and was imported from the library folder.