pdf-icon

UnitV Maixpy

Driver installation

Connect the device to PC, open the device manager to install FTDI driver for the device. Take Win10 as an example, download the driver file that matches your operating system, unzip it, and install it through the device manager. (Note: In some system environment, you need to install the driver twice before it takes effect, the unrecognized device name is usually M5Stack or USB Serial, Windows recommend to use the driver file in the device manager to install it directly (customize the update), the executable file installation method may not work properly). Click here to go to download FTDI driver
Note for MacOS users
For MacOS users before installing check System Preferences - > Security & Privacy - > General - > Apps allowed to be downloaded from the following locations - > App Store and Approved Developer Options.

Firmware burning

Kflash_GUI

  1. Download the firmware and Kflash_GUI burning tool.
Firmware version Download link
M5StickV_Firmware_v5.1.2.kfpkg Download
Software version Download link
Kflash_GUI_Windows Download
Kflash_GUI_MacOS Download
Kflash_GUI_Linux Download
  1. Connect the device to the computer through the Tpye-C cable, double-click to open the burning tool Kflash_GUI application, select the corresponding device port, board type (M5StickV), firmware program, baud rate. Click Download to start burning.

Serial debugging tools

1.Device USB will be enabled as system log port by default, users can use this interface to connect to the computer, use putty or MobaXterm or other terminal tools to access, the default baud rate is 115200bps, the following operation is based on the operation of putty, please click on the following link to download the putty installer, and according to the operation guide to achieve Login.

  1. After running Putty, connect the UnitV to the computer port via the Tpye-C cable, set the corresponding port number and baud rate in Putty, and click "open" to start the connection. (You can get the port number of the UnitV by checking the device manager.)
  1. After successful connection, you will automatically enter the interactive interface of MaixPy. At this point the device is running the default program, you can interrupt it by pressing the shortcut key "Ctrl+C" and enter the command line.

Editing and running files

Editing files

In an interactive interpreter (REPL), we can easily type in a program and get the results right away, but this is only suitable for verification of short programs. In real projects, the sheer volume of code makes it necessary to edit the code into individual files.

In MaixPy, there is a built-in open-source editor Micropython Editor(pye) , which makes it easy to modify program files.

Use os.listdir() to view the files in the current directory.

Use pye("hello.py") to create a file and enter editing mode (if a file with the same name already exists, it will only enter editing), shortcuts, etc.

After finishing editing in the editor, press Ctrl+S > Enter to save, press Ctrl+Q to exit the editor.

Note: Use of this editor on the use of serial tools have certain requirements, you must set the BackSpace button to DEL function, otherwise press BackSpace to call the Ctrl + H the same function (i.e., character substitution)

Run the file

Use os.chdir() to switch from the current directory to the file directory, e.g. os.chdir("/flash").

Method 1: import

Then run import hello.

and then run import hello to see the output hello maixpy.

This method is easy to use, but it is important to note that currently import can only be used once, if you import a second time, the file will not be executed, if you need to execute it more than once, it is recommended to use the following method

Method 2: exec()

Use the exec() function to execute the

with open("hello.py") as f:
    exec(f.read())

Auto-run scripts on boot

The system will create a boot.py file in the /flash or /sd directory, the boot will automatically execute this script first, edit the contents of this script to realize the boot.

MaixPy IDE

MaixPy IDE allows you to easily edit, upload and execute scripts in real time, as well as monitor camera images and transfer files in real time. The performance of MaixPy IDE will be reduced due to the resources required for data compression and transfer, but it is a good tool for developers who do not have demanding performance needs or are in the debugging phase.

Windows platform can directly double-click the exe file, run the installation program.

Linux command line to run permissions and then, execute the command

chmod +x maixpy-ide-linux-x86_64-0.2.2.run

./maixpy-ide-linux-x86_64-0.2.2.run

Run MaixPy IDE, click on the toolbar and select the board model. Tool-> Select Board-> M5StickV (Tools->Select Board)

Click the Connect button in the lower left corner and select the correct connection port, click OK.

When the connection button changes from green to red, it means that the connection has been successful, you can edit the code in the upper edit box, click on the run button in the lower left corner to execute the code, for verification.

WS2812

The firmware has built-in WS2812 RGB LED driver library, the following is the reference program. Note: Since the expansion port of UnitV does not have the ability to drive loads, this program is only suitable for driving the built-in RGB LEDs.

from modules import ws2812
from fpioa_manager import *
fm.register(8)
class_ws2812 = ws2812(8,100)
r=0
dir = True
while True:
    if dir:
        r += 5
    else:
        r -= 5
    if r>=255:
        r = 255
        dir = False
    elif r<0:
        r = 0
        dir = True
    for i in range(100):
        a = class_ws2812.set_led(i,(0,0,r))
    a=class_ws2812.display()
On This Page