点击下方连接下载匹配操作系统的驱动程序。目前存在两种驱动芯片版本(CP210X/CH9102), 请根据你所使用的版本下载对应的驱动程序压缩包. 在解压压缩包后,选择对应操作系统位数的安装包进行安装。(若您不确定您的设备所使用的USB芯片, 可同时安装两种驱动。CH9102_VCP_SER_MacOS v1.7
在安装过程中,可能出现报错,但实际上已经完成安装,忽略即可。)
驱动名称 | 适用驱动芯片 | 下载链接 |
---|---|---|
CP210x_VCP_Windows | CP2104 | Download |
CP210x_VCP_MacOS | CP2104 | Download |
CP210x_VCP_Linux | CP2104 | Download |
CH9102_VCP_SER_Windows | CH9102 | Download |
CH9102_VCP_SER_MacOS v1.7 | CH9102 | Download |
1.打开 Arduino IDE,选择 文件
->首选项
->设置
2.复制下方的 M5Stack 板管理网址到 附加开发板管理器:
中
https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
3.选择 工具
->开发板:
->开发板管理器...
4.在新弹出的对话框中,输入并搜索 M5Stack
,点击安装
(若出现搜索失败的情况,可以尝试重启Arduino程序)
5.选择 工具
->开发板:
->M5Stack Arduino
, 根据我们所使用的设备(M5Stack-Paper
)选择对应的开发板配置.
项目
->加载库
->库管理...
CoreInk
并安装,如下图所示。下载时请根据弹窗提示,安装相关依赖库。6.在弹出的对话框中搜索M5Stack-CoreInk
-> 点击安装
Tools
- > Port
- > COMx
), 点击菜单栏上的上传按钮(->
), 程序将会自动编译,上传至设备。 该程序将在M5-CoreInk的屏幕上打印"Hello World"字符串。
#include "M5CoreInk.h"
Ink_Sprite InkPageSprite(&M5.M5Ink);
/* After CoreInk is started or reset
the program in the setUp () function will be run, and this part will only be run once.
在 CoreInk 启动或者复位后,即会开始执行setup()函数中的程序,该部分只会执行一次。 */
void setup() {
M5.begin(); //Init CoreInk. 初始化 CoreInk
if( !M5.M5Ink.isInit()){ //Init CoreInk screen. 初始化 CoreInk 屏幕
Serial.printf("Ink Init faild"); //如果初始化失败,打印信息
while (1) delay(100);
}
M5.M5Ink.clear(); //Clear screen. 清屏
delay(1000);
if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 ){ //Create a sprite. 创建一个画布
Serial.printf("Ink Sprite creat faild");
}
InkPageSprite.drawString(35,50,"Hello World!"); //Draw a string. 绘制一个字符串
InkPageSprite.pushSprite(); //Push the sprite to screen. 将画布绘制到屏幕上
}
/* After the program in setup() runs, it runs the program in loop()
The loop() function is an infinite loop in which the program runs repeatedly
在setup()函数中的程序执行完后,会接着执行loop()函数中的程序
loop()函数是一个死循环,其中的程序会不断的重复运行 */
void loop() {
}
Github
Arduino API