Installing packages#

This section will guide you through the installation process of the required libraries using the pip package manager.

Unit Electronics Library Development#

Use method below to install different libraries developed by Unit Electronics.

Open a terminal and run the following command to install the library using pip:

pip install <name-library>

For example, to install the library chatos, run the following command:

pip install chatos

If the installation was successful, open a terminal and run the following command to verify the installation:

python -m chatos
Chatos

Fig. 24 Chatos Library Successfully Installed#

Libraries available#

  • Chatos : The library provides a set of tools to help developers work with the Chatos board. Stablish a communication between the computer and the microcontroller CH552 using the serial port to 9600 baud rate.

  • Loadupch : The library is a tool by load the firmware to the CH552 microcontroller.

DualMCU Library#

Firstly, you need install Thonny IDE. You can download it from the Thonny website.

  1. Open Thonny.

  2. Navigate to Tools -> Manage Packages.

  3. Search for dualmcu and click Install.

DualMCU Library

Fig. 25 DualMCU Library#

  1. Successfully installed the library.

DualMCU Library

Fig. 26 DualMCU Library Successfully Installed#

Alternatively, download the library from dualmcu.py.

Usage#

The library provides a set of tools to help developers work with the DualMCU ONE board. The following are the main features of the library:

  • I2C Support: The library provides support for I2C communication protocol, making it easy to interface with a wide range of sensors and devices.

  • Arduino Shields Compatibility: The library is compatible with Arduino Shields, making it easy to use a wide range of shields and accessories with the DualMCU ONE board.

  • SDcard Support: The library provides support for SD cards, allowing developers to easily read and write data to SD cards.

Examples of the library usage:

import machine
from dualmcu import *

i2c = machine.SoftI2C( scl=machine.Pin(22), sda=machine.Pin(21))

oled = SSD1306_I2C(128, 64, i2c)

oled.fill(1)
oled.show()

oled.fill(0)
oled.show()
oled.text('UNIT', 50, 10)
oled.text('ELECTRONICS', 25, 20)

oled.show()

Libraries available#

  • Dualmcu : The library provides a set of tools to help developers work with the DualMCU ONE board. The library is actively maintained and updated to provide the best experience for developers working with the DualMCU ONE board. For more information and updates, visit the dualmcu GitHub repository`

  • Ocks : The library provides support for I2C communication protocol.

  • SDcard-lib : The library provides support for SD cards, allowing developers to easily read and write data to SD cards; all rights remain with the original author.

The library is actively maintained and updated to provide the best experience for developers working with the DualMCU ONE board. For more information and updates, visit the dualmcu GitHub repository`