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
System Preferences
- > Security & Privacy
- > General
- > Apps allowed to be downloaded from the following locations
- > App Store and Approved Developer Options
.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.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.
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)
Use os.chdir()
to switch from the current directory to the file directory, e.g. os.chdir("/flash")
.
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
exec()
Use the exec()
function to execute the
with open("hello.py") as f:
exec(f.read())
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 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.
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()