Installing packages - Micropython#

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

Installation Guide Using MIP Library#

Note

The mip library is utilized to install other libraries on the NANOC6 board.

Requirements#

  • ESP32C6 device

  • Thonny IDE

  • Wi-Fi credentials (SSID and Password)

Installation Instructions#

Follow the steps below to install the max1704x.py library:

Connect to Wi-Fi#

Copy and run the code below in Thonny to connect your ESP32 to a Wi-Fi network:

import mip
import network
import time

def connect_wifi(ssid, password):
   wlan = network.WLAN(network.STA_IF)
   wlan.active(True)
   wlan.connect(ssid, password)

   for _ in range(10):
      if wlan.isconnected():
            print('Connected to the Wi-Fi network')
            return wlan.ifconfig()[0]
      time.sleep(1)

   print('Could not connect to the Wi-Fi network')
   return None


 ssid = "your_ssid"
 password = "your_password"

ip_address = connect_wifi(ssid, password)
print(ip_address)
mip.install('https://raw.githubusercontent.com/UNIT-Electronics/MAX1704X_lib/refs/heads/main/Software/MicroPython/example/max1704x.py')
mip.install('https://raw.githubusercontent.com/Cesarbautista10/Libraries_compatibles_with_micropython/refs/heads/main/Libs/oled.py')
mip.install('https://raw.githubusercontent.com/Cesarbautista10/Libraries_compatibles_with_micropython/refs/heads/main/Libs/sdcard.py')

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. 11 DualMCU Library#

  1. Successfully installed the library.

DualMCU Library

Fig. 12 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.