229 views|1 replies

21

Posts

0

Resources
The OP
 

【Follow me Season 2 Episode 1】 Libraries and support packages used in the development process [Copy link]

 

3. How to determine the library files required by CircuitPython

1. We need to use library files when using CircuitPython. These library files can be downloaded here https://circuitpython.org/libraries or you can get them from my attachments adafruit-circuitpython-bundle-9.x-mpy-20240728.zip (14.85 MB, downloads: 0)

adafruit-circuitpython-bundle-8.x-mpy-20240728.zip (14.84 MB, downloads: 0)


2. Now open the lib folder. When you open the folder, you will see a lot of .MPY files and folders.


3. How to import the library I need First open the lib folder on the CIRCUITPY drive. Then, open the lib folder extracted from the downloaded zip. Inside, you will find many folders and .mpy files. Find the library you want to use and copy it to the lib folder on CIRCUITPY.

If the library is a directory containing multiple .mpy files, make sure you copy the entire folder to CIRCUITPY/lib.


4. Which libraries do we need to install? Generally speaking, we need to import the name after import in the code.

For example, import library_or_module means we need the library_or_module


5. How to create your own .mpy file

mpy-cross

Please refer to the following link

https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/mpy-cross/

To create a .mpy file, run ./mpy-cross path/to/yourfile.py to create yourfile.mpy in the same directory as the original file.



4. How to uninstall CircuitPython

Maybe you tried CircuitPython and want to go back to MakeCode or Arduino

BACKUP YOUR CODE Before replacing CircuitPython, don't forget to backup your code on the CIRCUITPY drive. This means your code.py any other files, lib folders, etc.

Migrating to Arduino

If you want to use an Arduino instead, you can simply use the Arduino IDE to load the Arduino program. First plug in your board, then double-click reset until you get a green onboard LED. In the Arduino IDE, select a matching board, such as Circuit Playground Express. Make sure the LED is still green, then click Upload to upload Blink. After a successful upload, the serial port will change, so reselect the new port!

After uploading Blink, you should no longer need to double-click to enter bootloader mode. The Arduino will automatically reset when you upload.



5. Libraries we used in this process in CircuitPython

The above are all the library files used by me in this activity. These library files will be called in this form.

from adafruit_circuitplayground import cp

adafruit_ble

adafruit_bluefruit_connect

adafruit_bus_device

adafruit_circuitplayground

adafruit_gizmo

adafruit_hid

adafruit_lis3dh.mpy

adafruit_thermistor.mpy

neopixel.mpy

You can find these files in the zip file I provided.

If you want to use the source code format, please use the default format.

Here I am providing a lib integration package I used. See the attachment



6. Purpose of Appeal Library Files

adafruit_ble Bluetooth module

adafruit_bluefruit_connect Bluetooth connection to mobile phone module

adafruit_bus_device external bus access module manages i2c and spi buses

adafruit_circuitplayground Exclusive package for this board

adafruit_gizmo The TFT display module of this board

adafruit_hid driver emulates a USB HID device

adafruit_lis3dh.mpy library file for the accelerometer lis3dh

adafruit_thermistor.mpy NTC thermistor library file

neopixel.mpy strip light library file

This post is from DigiKey Technology Zone

Latest reply

BACKUP YOUR CODE Before replacing CircuitPython, don't forget to backup your code on the CIRCUITPY drive. This means your code.py any other files, lib folders, etc. This paragraph should be translated   Details Published on 2024-8-15 07:22
 
 

6580

Posts

0

Resources
2
 

BACKUP YOUR CODE Before replacing CircuitPython, don't forget to backup your code on the CIRCUITPY drive. This means your code.py any other files, lib folders, etc.

This paragraph should be translated

This post is from DigiKey Technology Zone
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list