You've already forked M5Core-Ink
mirror of
https://github.com/m5stack/M5Core-Ink.git
synced 2026-05-20 10:28:41 -07:00
Merge branch 'master' into patch-1
This commit is contained in:
@@ -2,100 +2,34 @@
|
||||
|
||||
English | [中文](README_cn.md)
|
||||
|
||||
<img src="http://docs.m5stack.com/assets/img/product_pics/core/coreink/coreink_01.webp" alt="CoreInk_Pic_01" width="350">
|
||||
<img src="https://static-cdn.m5stack.com/resource/docs/static/assets/img/product_pics/core/coreink/coreink_01.webp" alt="CoreInk_Pic_01" width="350">
|
||||
|
||||
## Description
|
||||
|
||||
**CoreInk** is a brand new E-ink display in the M5Stack cores range. Controlled by the ESP32-PICO-D4 This new device includes a 200x200 1.54" Black and White E-Ink Display. Compared to a regular LCD,E-ink displays are easier on the eyes, which makes them a great choice for reading or viewing for longer periods. Other benefits are the low power consumption and the ability to retain the image even if power to the display is terminated。For control the CoreInk integrates an multi-function button,A physical button, integrated status LED and buzzer.The device also includes a 390mAh Lipo,RTC(BM8563)for controlling accurate timing and deep sleep funcionality. CoreInk features independent reset and power buttons,expansion ports(HY2.0-4P、M-BUS、HAT expansion)for attaching external sensors to expand functionailty,for unlimited possibilities。
|
||||
|
||||
?>Warning: Please avoid using high refresh rates,reccommended refresh rate is(15s/per refresh), Do not expose to ultraviolet rays for a long time, otherwise it may cause irreversible damage to the ink screen.
|
||||
**Warning**: Please avoid using high refresh rates,reccommended refresh rate is(15s/per refresh), Do not expose to ultraviolet rays for a long time, otherwise it may cause irreversible damage to the ink screen.
|
||||
|
||||
<img src="http://docs.m5stack.com/assets/img/product_pics/core/coreink/coreink_02.webp" alt="CoreInk_Pic_02" width="350">
|
||||
<img class="pic" src="https://static-cdn.m5stack.com/resource/docs/static/assets/img/product_pics/core/coreink/coreink_02.webp" alt="CoreInk_Pic_01" width="350">
|
||||
|
||||
## Pin Mapping
|
||||
## Product Features
|
||||
|
||||
**E-Ink Display**
|
||||
- ESP32 Standard wireless functions Wi-Fi,Bluetooth
|
||||
- Internal 4M Flash
|
||||
- Low Power Display
|
||||
- 180 degree viewing angle
|
||||
- Expansion ports
|
||||
- Built-in Magnet
|
||||
- Internal Battery
|
||||
- Expandable
|
||||
|
||||
Screen Resolution:200x200
|
||||
|
||||
<table>
|
||||
<tr><td>ESP32 Chip</td><td>GPIO4</td><td>GPIO0</td><td>GPIO15</td><td>GPIO9</td><td>GPIO18</td><td>GPIO23</td></tr>
|
||||
<tr><td>GDEW0154M09</td><td>BUSY</td><td>RST</td><td>D/C</td><td>CS</td><td>SCK</td><td>MOSI</td></tr>
|
||||
</table>
|
||||
|
||||
**Multi-function button & Physical Button & LED & Buzzer**
|
||||
|
||||
<table>
|
||||
<tr><td>ESP32 Chip</td><td>GPIO37</td><td>GPIO38</td><td>GPIO39</td><td>GPIO5</td><td>GPIO10</td><td>GPIO2</td></tr>
|
||||
<tr><td>Multi-function button</td><td>Left position</td><td>Button press</td><td>Right position</td><td>/</td><td>/</td><td>/</td></tr>
|
||||
<tr><td>Physical Button</td><td>/</td><td>/</td><td>/</td><td>Physical Button</td><td>/</td><td>/</td></tr>
|
||||
<tr><td>LED</td><td>/</td><td>/</td><td>/</td><td>/</td><td>LED</td><td>/</td></tr>
|
||||
<tr><td>Buzzer</td><td>/</td><td>/</td><td>/</td><td>/</td><td>/</td><td>Buzzer</td></tr>
|
||||
</table>
|
||||
|
||||
**USB Serial**
|
||||
|
||||
<table>
|
||||
<tr><td>ESP32 Chip</td><td>GPIO1</td><td>GPIO3</td></tr>
|
||||
<tr><td>CP2104</td><td>RXD</td><td>TXD</td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
**Internal I2C Connection**
|
||||
|
||||
<table>
|
||||
<tr><td>ESP32 Chip</td><td>GPIO21</td><td>GPIO22</td></tr>
|
||||
<tr><td>BM8563</td><td>SDA</td><td>SCL</td></tr>
|
||||
</table>
|
||||
|
||||
## Coreink M-BUS Schematic
|
||||
|
||||
<!-- <img class="pic" src="assets/img/product_pics/core/core2/core2_mbus.webp" width = "50%"> -->
|
||||
|
||||
## Coreink-HY2.0 4P Port
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<th>PORT</th>
|
||||
<th>PIN</th>
|
||||
<th>Protocol:</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>EXT-PORT</td>
|
||||
<td>G32/33</td>
|
||||
<td>I2C</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## ESP32 ADC/DAC Mappable Pins
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<th>ADC1</th>
|
||||
<th>ADC2</th>
|
||||
<th>DAC1</th>
|
||||
<th>DAC2</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>8 Channel</td>
|
||||
<td>10 Channel</td>
|
||||
<td>2 Channel</td>
|
||||
<td>2 Channel</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>G32-39</td>
|
||||
<td>G0/2/4/12-15/25-27</td>
|
||||
<td>G25</td>
|
||||
<td>G26</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
For more info on specific pin functions refer to the official ESP32 Docs[ESP32 datasheet](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/esp32_datasheet_en.pdf)
|
||||
## More Information
|
||||
- **API**
|
||||
- [Arduino API](http://docs.m5stack.com/#/en/arduino/arduino_home_page)
|
||||
|
||||
- **Document**
|
||||
- [Arduino Quick Start](http://docs.m5stack.com/en/quick_start/coreink/arduino)
|
||||
- [Product Document](https://docs.m5stack.com/en/core/coreink)
|
||||
## Related Link
|
||||
|
||||
- **Datasheet**
|
||||
@@ -103,15 +37,3 @@ For more info on specific pin functions refer to the official ESP32 Docs[ESP32 d
|
||||
- [BM8563](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/BM8563_V1.1_cn.pdf)
|
||||
- [SY7088](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/SY7088-Silergy.pdf)
|
||||
- [GDEW0154M09](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/CoreInk-K048-GDEW0154M09%20V2.0%20Specification.pdf)
|
||||
|
||||
- **API**
|
||||
|
||||
- [Arduino API](http://docs.m5stack.com/#/en/arduino/arduino_home_page)
|
||||
|
||||
## Tutorial&Quick-Start
|
||||
|
||||
<a href="http://docs.m5stack.com/#/en/quick_start/coreink/quick_start_arduino"><el-tag effect="plain">Arduino</el-tag></a>
|
||||
|
||||
## Schematic
|
||||
|
||||
<img src="http://docs.m5stack.com/assets/img/product_pics/core/coreink/coreink_sch1.webp">
|
||||
|
||||
+19
-87
@@ -2,95 +2,38 @@
|
||||
|
||||
[English](README.md) | 中文
|
||||
|
||||
<img src="http://docs.m5stack.com/assets/img/product_pics/core/coreink/coreink_01.webp" alt="CoreInk_Pic_01" width="350">
|
||||
<img src="https://static-cdn.m5stack.com/resource/docs/static/assets/img/product_pics/core/coreink/coreink_01.webp" alt="CoreInk_Pic_01" width="350">
|
||||
|
||||
## 描述
|
||||
|
||||
**CoreInk** 是M5Stack推出的一款带有电子墨水屏(E-Ink)的主控设备,控制器采用ESP32-PICO-D4。正面嵌入了一块分辨率为200x200 @ 1.54"的电子墨水屏,支持黑/白显示。相对于普通的LCD的屏幕,电子墨水屏能够提供用户更好的文本阅读体验, 同时具有低功耗,掉电图像保持等特性。人机交互方面提供了拨轮开关,与物理按键, 集成LED指示灯与蜂鸣器。内置了390mAh锂电池,结合内部的RTC(BM8563)可实现定时休眠与唤醒功能,能够为设备提供较为优秀的续航能力。在机身的左侧和底部配有独立的电源按键与复位(RST)按键,方便使用与调试。开放了丰富的外设接口(HY2.0-4P、M-BUS、HAT模块接口)能够拓展各式各样的传感器设备,为后续的应用功能开发提供无限可能。
|
||||
|
||||
?>注意事项: 使用时请注意避免长时间高频刷新,建议刷新间隔为(15s/次), 请勿长时间暴露在紫外线下, 否则有可能对墨水屏造成不可逆的损害。
|
||||
**注意事项**: 使用时请注意避免长时间高频刷新,建议刷新间隔为(15s/次), 请勿长时间暴露在紫外线下, 否则有可能对墨水屏造成不可逆的损害。
|
||||
|
||||
<img src="http://docs.m5stack.com/assets/img/product_pics/core/coreink/coreink_02.webp" alt="CoreInk_Pic_02" width="350">
|
||||
* **如果想要购买 CoreInk 的话,[点击这里](https://item.taobao.com/item.htm?spm=a1z10.5-c-s.w4002-22404213529.11.5d80e428hIJBNY&id=631373978142)**
|
||||
|
||||
## 管脚映射
|
||||
<img class="pic" src="https://static-cdn.m5stack.com/resource/docs/static/assets/img/product_pics/core/coreink/coreink_02.webp" alt="CoreInk_Pic_01" width="350">
|
||||
|
||||
**墨水屏幕**
|
||||
## 产品特性
|
||||
|
||||
屏幕像素:200x200
|
||||
- 基于 ESP32 开发,支持WiFi,蓝牙
|
||||
- 内置4M Flash
|
||||
- 低功耗显示面板
|
||||
- 近180度可视角
|
||||
- 人机交互接口
|
||||
- 背面磁吸设计
|
||||
- 内置锂电池
|
||||
- 丰富的拓展接口
|
||||
|
||||
<table>
|
||||
<tr><td>ESP32 Chip</td><td>GPIO4</td><td>GPIO0</td><td>GPIO15</td><td>GPIO9</td><td>GPIO18</td><td>GPIO23</td></tr>
|
||||
<tr><td>GDEW0154M09</td><td>BUSY</td><td>RST</td><td>D/C</td><td>CS</td><td>SCK</td><td>MOSI</td></tr>
|
||||
</table>
|
||||
## 更多信息
|
||||
|
||||
**拨轮开关 & 物理按键 & LED & 蜂鸣器**
|
||||
- **API**
|
||||
|
||||
<table>
|
||||
<tr><td>ESP32 Chip</td><td>GPIO37</td><td>GPIO38</td><td>GPIO39</td><td>GPIO5</td><td>GPIO10</td><td>GPIO2</td></tr>
|
||||
<tr><td>拨轮开关</td><td>右</td><td>中</td><td>左</td><td>/</td><td>/</td><td>/</td></tr>
|
||||
<tr><td>物理按键</td><td>/</td><td>/</td><td>/</td><td>物理按键</td><td>/</td><td>/</td></tr>
|
||||
<tr><td>LED</td><td>/</td><td>/</td><td>/</td><td>/</td><td>LED</td><td>/</td></tr>
|
||||
<tr><td>蜂鸣器</td><td>/</td><td>/</td><td>/</td><td>/</td><td>/</td><td>蜂鸣器</td></tr>
|
||||
</table>
|
||||
|
||||
**USB转串口下载**
|
||||
|
||||
<table>
|
||||
<tr><td>ESP32 Chip</td><td>GPIO1</td><td>GPIO3</td></tr>
|
||||
<tr><td>CP2104</td><td>RXD</td><td>TXD</td></tr>
|
||||
</table>
|
||||
|
||||
**内部I2C连接**
|
||||
|
||||
<table>
|
||||
<tr><td>ESP32 Chip</td><td>GPIO21</td><td>GPIO22</td></tr>
|
||||
<tr><td>BM8563</td><td>SDA</td><td>SCL</td></tr>
|
||||
</table>
|
||||
|
||||
## Coreink-HY2.0 4P端口
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<th>PORT</th>
|
||||
<th>PIN</th>
|
||||
<th>备注:</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>EXT-PORT</td>
|
||||
<td>G32/33</td>
|
||||
<td>I2C</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## ESP32 ADC/DAC可映射引脚
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<th>ADC1</th>
|
||||
<th>ADC2</th>
|
||||
<th>DAC1</th>
|
||||
<th>DAC2</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>8 通道</td>
|
||||
<td>10 通道</td>
|
||||
<td>2 通道</td>
|
||||
<td>2 通道</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>G32-39</td>
|
||||
<td>G0/2/4/12-15/25-27</td>
|
||||
<td>G25</td>
|
||||
<td>G26</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
有关引脚分配和引脚重新映射的更多信息,请参考[ESP32 datasheet](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/esp32_datasheet_cn.pdf)
|
||||
- [CoreInk Arduino API](http://docs.m5stack.com/zh_CN/api/coreink/system_api)
|
||||
|
||||
- **Document**
|
||||
- [Arduino Quick Start](http://docs.m5stack.com/zh_CN/quick_start/coreink/arduino)
|
||||
- [Product Document](https://docs.m5stack.com/zh_CN/core/coreink)
|
||||
|
||||
## 相关链接
|
||||
|
||||
@@ -100,14 +43,3 @@
|
||||
- [SY7088](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/SY7088-Silergy.pdf)
|
||||
- [GDEW0154M09](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/CoreInk-K048-GDEW0154M09%20V2.0%20Specification.pdf)
|
||||
|
||||
- **API**
|
||||
|
||||
- [Arduino API](http://docs.m5stack.com/#/zh_CN/arduino/arduino_home_page)
|
||||
|
||||
## 教程&快速上手
|
||||
|
||||
<a href="http://docs.m5stack.com/#/zh_CN/quick_start/coreink/quick_start_arduino"><el-tag effect="plain">Arduino</el-tag></a>
|
||||
|
||||
## 原理图
|
||||
|
||||
<img src="http://docs.m5stack.com/assets/img/product_pics/core/coreink/coreink_sch1.webp">
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2021 by M5Stack
|
||||
* Equipped with CoreInk sample source code
|
||||
* 配套 CoreInk 示例源代码
|
||||
* Visit the website for more information:https://docs.m5stack.com/en/core/coreink
|
||||
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/coreink
|
||||
*
|
||||
* describe:Counter.
|
||||
* date:2021/11/28
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <M5CoreInk.h>
|
||||
#include <Preferences.h>
|
||||
|
||||
Preferences preferences;
|
||||
Ink_Sprite InkPageSprite(&M5.M5Ink); //创建 M5Ink实例
|
||||
|
||||
char Strbuff[64];
|
||||
|
||||
void setup() {
|
||||
M5.begin();
|
||||
digitalWrite(LED_EXT_PIN,LOW); //设置 LED_EXT_PIN 为低电平
|
||||
if( !M5.M5Ink.isInit()){ //判断 M5Ink 是否初始化成功
|
||||
Serial.printf("Ink Init faild");
|
||||
while (1) delay(100);
|
||||
}
|
||||
M5.M5Ink.clear(); //clear the screen. 清屏
|
||||
delay(1000);
|
||||
//creat ink Sprite. 创建图像区域
|
||||
if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 ){
|
||||
Serial.printf("Ink Sprite creat faild");
|
||||
}
|
||||
InkPageSprite.drawString(10,10,"Counter"); //在图像区域内绘制字符串
|
||||
preferences.begin("my-app", false); //We will open storage in RW-mode (second parameter has to be false). 在perferences中创建叫my-app的空间,并以rw模式打开存储(第二个参数必须为false)
|
||||
|
||||
//preferences.clear(); // Remove all preferences under the opened namespace.清除preferences中所有的空间
|
||||
//preferences.remove("counter"); // Or remove the counter key only. 只清除counter中的值
|
||||
|
||||
unsigned int counter = preferences.getUInt("counter", 0); //Get the counter value in current sapce, if the key does not exist, return a default value of 0. 在当前空间中读取counter的值(若不存在为0),并赋值给counter
|
||||
counter++; //Increase counter by 1. 使计数器的值加一
|
||||
sprintf(Strbuff,"Current counter value:%u",counter);
|
||||
InkPageSprite.drawString(5,40,Strbuff);
|
||||
preferences.putUInt("counter", counter); // Store the counter to the Preferences. 存储计数器的值
|
||||
preferences.end(); // Close the Preferences. 关闭Preferences
|
||||
InkPageSprite.drawString(10,75,"Restart in 15 s");
|
||||
InkPageSprite.pushSprite(); //将图像区域内的内容推送到屏幕上
|
||||
delay(15000); //delay 10. 延迟10s
|
||||
ESP.restart(); // Restart. 重启
|
||||
}
|
||||
void loop() {}
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2021 by M5Stack
|
||||
* Equipped with CoreInk sample source code
|
||||
* 配套 CoreInk 示例源代码
|
||||
* Visit the website for more information:https://docs.m5stack.com/en/core/coreink
|
||||
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/coreink
|
||||
*
|
||||
* describe:EEPROM Write.
|
||||
* date:2021/11/28
|
||||
*******************************************************************************
|
||||
The values stored in the EEPROM will remain in the EEPROM even after the CoreInk is disconnected.
|
||||
When a new program is uploaded to the CoreInk, the values stored in the EEPROM can still be called or modified by the new program.
|
||||
储存于EEPROM的数值即使在断开 CoreInk开发板电源后仍会保存在EEPROM中
|
||||
当新程序上传到 CoreInk后,储存于EEPROM中的数值仍然可以被新的程序调用或者修改
|
||||
*/
|
||||
|
||||
#include <M5CoreInk.h>
|
||||
#include <EEPROM.h>
|
||||
|
||||
Ink_Sprite InkPageSprite(&M5.M5Ink); //创建 M5Ink实例
|
||||
|
||||
int addr = 0; //EEPROM Start number of an ADDRESS. EEPROM地址起始编号
|
||||
#define SIZE 32 //define the size of EEPROM(Byte). 定义EEPROM的大小(字节)
|
||||
|
||||
void setup() {
|
||||
M5.begin(); //Init CoreInk. 初始化 CoreInk
|
||||
digitalWrite(LED_EXT_PIN,LOW); //设置 LED_EXT_PIN 为低电平
|
||||
if( !M5.M5Ink.isInit()){ //判断 M5Ink 是否初始化成功
|
||||
Serial.printf("Ink Init faild");
|
||||
while (1) delay(100);
|
||||
}
|
||||
M5.M5Ink.clear(); //clear the screen. 清屏
|
||||
delay(1000);
|
||||
//creat ink Sprite. 创建图像区域
|
||||
if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 ){
|
||||
Serial.printf("Ink Sprite creat faild");
|
||||
}
|
||||
InkPageSprite.drawString(10,10,"EEPROM"); //在图像区域内绘制字符串
|
||||
if (!EEPROM.begin(SIZE)){ //Request storage of SIZE size(success return 1). 申请SIZE大小的存储(成功返回1)
|
||||
Serial.println("\nFailed to initialise EEPROM!"); //串口输出格式化字符串. Serial output format string
|
||||
delay(1000000);
|
||||
}
|
||||
Serial.println("\nRead data from EEPROM. Values are:");
|
||||
for (int i = 0; i < SIZE; i++){
|
||||
Serial.printf("%d ",EEPROM.read(i)); //Reads data from 0 to SIZE in EEPROM. 读取EEPROM中从0到SIZE中的数据
|
||||
}
|
||||
Serial.println("\n\nPress BtnA to Write EEPROM");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
M5.update(); //Check button down state. 检测按键按下状态
|
||||
if(M5.BtnEXT.isPressed()){ //if the button.A is Pressed. 如果按键A按下
|
||||
Serial.printf("\n%d Bytes datas written on EEPROM.\nValues are:\n",SIZE);
|
||||
for(int i=0;i<SIZE;i++){
|
||||
int val = random(256); //Integer values to be stored in the EEPROM (EEPROM can store one byte per memory address, and can only store numbers from 0 to 255. Therefore, if you want to use EEPROM to store the numeric value read by the analog input pin, divide the numeric value by 4.
|
||||
//将要存储于EEPROM的整数数值(EEPROM每一个存储地址可以储存一个字节,只能存储0-255的数.故如果要使用EEPROM存储模拟输入引脚所读取到的数值需要将该数值除以4)
|
||||
EEPROM.write(addr, val); //Writes the specified data to the specified address. 向指定地址写入指定数据
|
||||
Serial.printf("%d ",val);
|
||||
addr += 1; //Go to the next storage address. 转入下一存储地址
|
||||
}
|
||||
//When the storage address sequence number reaches the end of the storage space of the EEPROM, return to. 当存储地址序列号达到EEPROM的存储空间结尾,返回到EEPROM开始地址
|
||||
addr = 0;
|
||||
Serial.println("\n\nRead form EEPROM. Values are:");
|
||||
for(int i=0;i<SIZE;i++){
|
||||
Serial.printf("%d ",EEPROM.read(i));
|
||||
}
|
||||
Serial.println("\n-------------------------------------\n");
|
||||
}
|
||||
delay(150);
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2021 by M5Stack
|
||||
* Equipped with CoreInk sample source code
|
||||
* 配套 CoreInk 示例源代码
|
||||
* Visit the website for more information:https://docs.m5stack.com/en/core/coreink
|
||||
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/coreink
|
||||
*
|
||||
* describe:EzData
|
||||
* date:2021/11/27
|
||||
*******************************************************************************
|
||||
*/
|
||||
#include "M5CoreInk.h"
|
||||
#include "M5_EzData.h"
|
||||
|
||||
Ink_Sprite InkPageSprite(&M5.M5Ink); //创建 M5Ink实例
|
||||
|
||||
// Configure the name and password of the connected wifi and your token. 配置所连接wifi的名称、密码以及你的token
|
||||
const char* ssid = "Explore-F";
|
||||
const char* password = "xingchentansuo123";
|
||||
const char* token = "JT8H8eSd0A0pKajNzGm2tDL2H6mjIVLc";
|
||||
|
||||
void setup() {
|
||||
M5.begin();
|
||||
digitalWrite(LED_EXT_PIN,LOW); //设置 LED_EXT_PIN 为低电平
|
||||
if( !M5.M5Ink.isInit()){ //判断 M5Ink 是否初始化成功
|
||||
Serial.printf("Ink Init faild");
|
||||
while (1) delay(100);
|
||||
}
|
||||
M5.M5Ink.clear(); //clear the screen. 清屏
|
||||
delay(1000);
|
||||
//creat ink Sprite. 创建图像区域
|
||||
if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 ){
|
||||
Serial.printf("Ink Sprite creat faild");
|
||||
}
|
||||
if(setupWifi(ssid,password)){ //Connect to wifi. 连接到wifi
|
||||
InkPageSprite.drawString(10,10,"Success connecting to "); //在图像区域内绘制字符串
|
||||
InkPageSprite.drawString(10,25,ssid); //在图像区域内绘制字符串
|
||||
}else{
|
||||
InkPageSprite.drawString(10,10,"Connecting failed"); //在图像区域内绘制字符串
|
||||
}
|
||||
InkPageSprite.pushSprite(); //将图像区域内的内容推送到屏幕上
|
||||
}
|
||||
|
||||
void loop() {
|
||||
//Save the data 20 to the top of the testData topic queue. 保存数据20至 testData 队列首位
|
||||
if(setData(token,"testData",20)){
|
||||
InkPageSprite.drawString(10,50,"Success sending data");
|
||||
}else{
|
||||
InkPageSprite.drawString(10,50,"Fail to save data");
|
||||
}
|
||||
delay(10000);
|
||||
InkPageSprite.pushSprite(); //将图像区域内的内容推送到屏幕上
|
||||
|
||||
//Save 3 data in sequence to the first place of testList. 依次保存3个数据至 testList首位
|
||||
for(int i=0;i<3;i++){
|
||||
if(addToList(token,"testList",i)){
|
||||
InkPageSprite.drawString(10,65,"Success sending data");
|
||||
}else{
|
||||
InkPageSprite.drawString(10,65,"Fail to save data");
|
||||
}
|
||||
delay(100);
|
||||
}
|
||||
delay(10000);
|
||||
InkPageSprite.pushSprite(); //将图像区域内的内容推送到屏幕上
|
||||
//Get a piece of data from a topic and store the value in result. 从一个 topic中获取一个数据,并将值存储在 result
|
||||
int result=0;
|
||||
if(getData(token,"testData",result)){
|
||||
InkPageSprite.drawString(10,80,"Success get data");
|
||||
}else{
|
||||
InkPageSprite.drawString(10,80,"Fail to get data");
|
||||
}
|
||||
delay(10000);
|
||||
InkPageSprite.pushSprite(); //将图像区域内的内容推送到屏幕上
|
||||
|
||||
//Remove data
|
||||
if(removeData(token,"testData"))
|
||||
InkPageSprite.drawString(10,95,"Success remove data");
|
||||
else
|
||||
InkPageSprite.drawString(10,95,"Fail to remove data");
|
||||
|
||||
if(removeData(token,"testList"))
|
||||
InkPageSprite.drawString(10,110,"Success remove data");
|
||||
else
|
||||
InkPageSprite.drawString(10,110,"Fail to remove data");
|
||||
delay(10000);
|
||||
InkPageSprite.pushSprite(); //将图像区域内的内容推送到屏幕上
|
||||
delay(10000);
|
||||
InkPageSprite.clear(); //clear the screen. 清屏
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2021 by M5Stack
|
||||
* Equipped with CoreInk sample source code
|
||||
* 配套 CoreInk 示例源代码
|
||||
* Visit the website for more information:https://docs.m5stack.com/en/core/coreink
|
||||
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/coreink
|
||||
*
|
||||
* describe:I2C Scanner. I2C探测
|
||||
* date:2021/11/27
|
||||
*******************************************************************************
|
||||
*/
|
||||
/*
|
||||
This program scans the addresses 1-127 continuosly and shows the devices found on the TFT.
|
||||
该程序连续扫描地址 1-127 并显示在外部(内部)I2C发现的设备。
|
||||
*/
|
||||
#include <M5CoreInk.h>
|
||||
|
||||
void setup()
|
||||
{
|
||||
M5.begin(false,true,false); //Init M5Core2(Initialization of external I2C is also included). 初始化M5Core2(初始化外部I2C也包含在内)
|
||||
//Wire.begin(21, 22); //Detect internal I2C, if this sentence is not added, it will detect external I2C. 检测内部I2C,若不加此句为检测外部I2C
|
||||
Serial.println("M5Core2 I2C Tester"); //Print a string on the screen. 在屏幕上打印字符串
|
||||
delay(3000);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
int address;
|
||||
int error;
|
||||
Serial.println("scanning Address [HEX]");
|
||||
for(address = 1; address < 127; address++ )
|
||||
{
|
||||
Wire.beginTransmission(address); //Data transmission to the specified device address starts. 开始向指定的设备地址进行传输数据
|
||||
error = Wire.endTransmission(); /*Stop data transmission with the slave. 停止与从机的数据传输
|
||||
0: success. 成功
|
||||
1: The amount of data exceeds the transmission buffer capacity limit. 数据量超过传送缓存容纳限制
|
||||
return value: 2: Received NACK when sending address. 传送地址时收到 NACK
|
||||
3: Received NACK when transmitting data. 传送数据时收到 NACK
|
||||
4: Other errors. 其它错误 */
|
||||
if(error==0)
|
||||
{
|
||||
Serial.print(address,HEX);
|
||||
Serial.print(" ");
|
||||
}
|
||||
else Serial.print(".");
|
||||
|
||||
delay(10);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2021 by M5Stack
|
||||
* Equipped with CoreInk sample source code
|
||||
* 配套 CoreInk 示例源代码
|
||||
* Visit the website for more information:https://docs.m5stack.com/en/core/coreink
|
||||
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/coreink
|
||||
*
|
||||
* describe:MQTT.
|
||||
* date:2021/11/28
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <M5CoreInk.h>
|
||||
#include <WiFi.h>
|
||||
#include <PubSubClient.h>
|
||||
|
||||
WiFiClient espClient;
|
||||
PubSubClient client(espClient);
|
||||
Ink_Sprite InkPageSprite(&M5.M5Ink);
|
||||
|
||||
// Configure the name and password of the connected wifi and your MQTT Serve host. 配置所连接wifi的名称、密码以及你MQTT服务器域名
|
||||
const char* ssid = "Explore-F";
|
||||
const char* password = "xingchentansuo123";
|
||||
const char* mqtt_server = "mqtt.m5stack.com";
|
||||
|
||||
#define MSG_BUFFER_SIZE (50)
|
||||
unsigned long lastMsg = 0;
|
||||
char msg[MSG_BUFFER_SIZE];
|
||||
int value = 0;
|
||||
|
||||
void setupWifi();
|
||||
void callback(char* topic, byte* payload, unsigned int length);
|
||||
void reConnect();
|
||||
|
||||
void setup() {
|
||||
M5.begin();
|
||||
digitalWrite(LED_EXT_PIN,LOW); //设置 LED_EXT_PIN 为低电平
|
||||
if( !M5.M5Ink.isInit()){ //判断 M5Ink 是否初始化成功
|
||||
Serial.printf("Ink Init faild");
|
||||
while (1) delay(100);
|
||||
}
|
||||
M5.M5Ink.clear(); //clear the screen. 清屏
|
||||
delay(1000);
|
||||
//creat ink Sprite. 创建图像区域
|
||||
if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 ){
|
||||
Serial.printf("Ink Sprite creat faild");
|
||||
}
|
||||
InkPageSprite.drawString(10,10,"MQTT"); //在图像区域内绘制字符串
|
||||
setupWifi();
|
||||
client.setServer(mqtt_server, 1883); //Sets the server details. 配置所连接的服务器
|
||||
client.setCallback(callback); //Sets the message callback function. 设置消息回调函数
|
||||
InkPageSprite.pushSprite(); //将图像区域内的内容推送到屏幕上
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (!client.connected()) {
|
||||
reConnect();
|
||||
}
|
||||
client.loop(); //This function is called periodically to allow clients to process incoming messages and maintain connections to the server.
|
||||
//定期调用此函数,以允许主机处理传入消息并保持与服务器的连接
|
||||
|
||||
unsigned long now = millis(); //Obtain the host startup duration. 获取主机开机时长
|
||||
if (now - lastMsg > 2000) {
|
||||
lastMsg = now;
|
||||
++value;
|
||||
snprintf (msg, MSG_BUFFER_SIZE, "hello world #%ld", value); //Format to the specified string and store it in MSG. 格式化成指定字符串并存入msg中
|
||||
Serial.print("Publish message: ");
|
||||
Serial.println(msg);
|
||||
client.publish("M5Stack", msg); //Publishes a message to the specified topic. 发送一条消息至指定话题
|
||||
}
|
||||
}
|
||||
|
||||
void setupWifi() {
|
||||
delay(10);
|
||||
Serial.printf("Connecting to %s",ssid);
|
||||
WiFi.mode(WIFI_STA); //Set the mode to WiFi station mode. 设置模式为WIFI站模式
|
||||
WiFi.begin(ssid, password); //Start Wifi connection. 开始wifi连接
|
||||
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
delay(500);
|
||||
Serial.print(".");
|
||||
}
|
||||
Serial.printf("\nSuccess\n");
|
||||
InkPageSprite.drawString(10,25,"Success connecting wifi "); //在图像区域内绘制字符串
|
||||
InkPageSprite.drawString(10,40,"Please see the serial"); //在图像区域内绘制字符串
|
||||
}
|
||||
|
||||
void callback(char* topic, byte* payload, unsigned int length) {
|
||||
Serial.print("Message arrived [");
|
||||
Serial.print(topic);
|
||||
Serial.print("] ");
|
||||
for (int i = 0; i < length; i++) {
|
||||
Serial.print((char)payload[i]);
|
||||
}
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
void reConnect() {
|
||||
while (!client.connected()) {
|
||||
Serial.print("Attempting MQTT connection...");
|
||||
// Create a random client ID. 创建一个随机的客户端ID
|
||||
String clientId = "M5Stack-";
|
||||
clientId += String(random(0xffff), HEX);
|
||||
// Attempt to connect. 尝试重新连接
|
||||
if (client.connect(clientId.c_str())) {
|
||||
Serial.printf("\nSuccess\n");
|
||||
// Once connected, publish an announcement to the topic. 一旦连接,发送一条消息至指定话题
|
||||
client.publish("M5Stack", "hello world");
|
||||
// ... and resubscribe. 重新订阅话题
|
||||
client.subscribe("M5Stack");
|
||||
} else {
|
||||
Serial.print("failed, rc=");
|
||||
Serial.print(client.state());
|
||||
Serial.println("try again in 5 seconds");
|
||||
delay(5000);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2021 by M5Stack
|
||||
* Equipped with M5Core2 sample source code
|
||||
* 配套 M5Core2 示例源代码
|
||||
* Visit the website for more information:https://docs.m5stack.com/en/core/core2
|
||||
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/core2
|
||||
*
|
||||
* describe:MultSerial. 多串口
|
||||
* date:2021/8/5
|
||||
******************************************************************************
|
||||
*/
|
||||
#include <M5Core2.h>
|
||||
|
||||
void setup() {
|
||||
M5.begin(); //Init M5Core2. 初始化 M5Core2
|
||||
// Serial2.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
|
||||
Serial2.begin(115200, SERIAL_8N1, 13, 14); //Init serial port 2. 初始化串口2
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if(Serial.available()) { //If the serial port reads data. 如果串口读到数据
|
||||
int ch = Serial.read(); // Copy the data read from the serial port to the CH. 把串口读取到的数据复制给ch
|
||||
Serial2.write(ch); //Serial port 2 Outputs the CH content. 串口2输出ch的内容
|
||||
M5.Lcd.printf("Serial:%d\n",ch); //The screen prints the data received by serial port 2. 屏幕打印串口2收到的数据
|
||||
}
|
||||
|
||||
if(Serial2.available()) {
|
||||
int ch = Serial2.read();
|
||||
Serial.write(ch);
|
||||
M5.Lcd.printf("Serial2:%d\n",ch);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2021 by M5Stack
|
||||
* Equipped with CoreInk sample source code
|
||||
* 配套 CoreInk 示例源代码
|
||||
* Visit the website for more information:https://docs.m5stack.com/en/core/coreink
|
||||
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/coreink
|
||||
*
|
||||
* describe:MultiTask.
|
||||
* date:2021/11/28
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <M5CoreInk.h>
|
||||
|
||||
Ink_Sprite InkPageSprite(&M5.M5Ink); //创建 M5Ink实例
|
||||
|
||||
void task1(void * pvParameters) { //Define the tasks to be executed in thread 1. 定义线程1内要执行的任务
|
||||
while(1){ //Keep the thread running. 使线程一直运行
|
||||
Serial.print("task1 Uptime (ms): ");
|
||||
Serial.println(millis()); //The running time of the serial port printing program. 串口打印程序运行的时间
|
||||
delay(100); //With a delay of 100ms, it can be seen in the serial monitor that every 100ms, thread 1 will be executed once. 延迟100ms,在串口监视器内可看到每隔100ms,线程1就会被执行一次
|
||||
}
|
||||
}
|
||||
|
||||
void task2(void * pvParameters) {
|
||||
while(1){
|
||||
Serial.print("task2 Uptime (ms): ");
|
||||
Serial.println(millis());
|
||||
delay(200);
|
||||
}
|
||||
}
|
||||
|
||||
void task3(void * pvParameters) {
|
||||
while(1){
|
||||
Serial.print("task3 Uptime (ms): ");
|
||||
Serial.println(millis());
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
void setup() {
|
||||
M5.begin();
|
||||
digitalWrite(LED_EXT_PIN,LOW); //设置 LED_EXT_PIN 为低电平
|
||||
if( !M5.M5Ink.isInit()){ //判断 M5Ink 是否初始化成功
|
||||
Serial.printf("Ink Init faild");
|
||||
while (1) delay(100);
|
||||
}
|
||||
M5.M5Ink.clear(); //clear the screen. 清屏
|
||||
delay(1000);
|
||||
//creat ink Sprite. 创建图像区域
|
||||
if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 ){
|
||||
Serial.printf("Ink Sprite creat faild");
|
||||
}
|
||||
InkPageSprite.drawString(10,10,"MultiTask"); //在图像区域内绘制字符串
|
||||
InkPageSprite.drawString(10,25,"Please see the serial");
|
||||
|
||||
InkPageSprite.pushSprite(); //将图像区域内的内容推送到屏幕上
|
||||
// Creat Task1. 创建线程1
|
||||
xTaskCreatePinnedToCore(
|
||||
task1, //Function to implement the task. 线程对应函数名称(不能有返回值)
|
||||
"task1", //线程名称
|
||||
4096, // The size of the task stack specified as the number of * bytes.任务堆栈的大小(字节)
|
||||
NULL, // Pointer that will be used as the parameter for the task * being created. 创建作为任务输入参数的指针
|
||||
1, // Priority of the task. 任务的优先级
|
||||
NULL, // Task handler. 任务句柄
|
||||
0); // Core where the task should run. 将任务挂载到指定内核
|
||||
|
||||
// Task 2
|
||||
xTaskCreatePinnedToCore(
|
||||
task2,
|
||||
"task2",
|
||||
4096,
|
||||
NULL,
|
||||
2,
|
||||
NULL,
|
||||
0);
|
||||
|
||||
// Task 3
|
||||
xTaskCreatePinnedToCore(
|
||||
task3,
|
||||
"task3",
|
||||
4096,
|
||||
NULL,
|
||||
3,
|
||||
NULL,
|
||||
0);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
}
|
||||
+46
-22
@@ -1,39 +1,63 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2021 by M5Stack
|
||||
* Equipped with CoreInk sample source code
|
||||
* 配套 CoreInk 示例源代码
|
||||
* Visit for more information:https://docs.m5stack.com/en/core/coreink
|
||||
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/coreink
|
||||
*
|
||||
* describe:Button example. 按键示例
|
||||
* date:2022/6/30
|
||||
*******************************************************************************
|
||||
*/
|
||||
#include "M5CoreInk.h"
|
||||
|
||||
Ink_Sprite InkPageSprite(&M5.M5Ink);
|
||||
Ink_Sprite InkPageSprite(&M5.M5Ink); //创建 M5Ink实例
|
||||
|
||||
void ButtonTest(char* str)
|
||||
{
|
||||
InkPageSprite.clear();
|
||||
InkPageSprite.drawString(35,59,str);
|
||||
InkPageSprite.pushSprite();
|
||||
void ButtonTest(char* str) {
|
||||
InkPageSprite.clear(); // clear the screen. 清屏
|
||||
InkPageSprite.drawString(35, 59, str); // draw the string. 绘制字符串
|
||||
InkPageSprite.pushSprite(); // push the sprite. 推送图片
|
||||
delay(2000);
|
||||
}
|
||||
|
||||
/* 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();
|
||||
if( !M5.M5Ink.isInit())
|
||||
{
|
||||
M5.begin(); // Initialize CoreInk. 初始化 CoreInk
|
||||
if (!M5.M5Ink.isInit()) { // check if the initialization is successful.
|
||||
// 检查初始化是否成功
|
||||
Serial.printf("Ink Init faild");
|
||||
}
|
||||
M5.M5Ink.clear();
|
||||
M5.M5Ink.clear(); // Clear the screen. 清屏
|
||||
delay(1000);
|
||||
//creat ink refresh Sprite
|
||||
if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 )
|
||||
{
|
||||
Serial.printf("Ink Sprite create failed");
|
||||
// creat ink Sprite. 创建图像区域
|
||||
if (InkPageSprite.creatSprite(0, 0, 200, 200, true) != 0) {
|
||||
Serial.printf("Ink Sprite create faild");
|
||||
}
|
||||
InkPageSprite.drawString(20, 20, "Hello Core-INK");
|
||||
}
|
||||
|
||||
/* 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() {
|
||||
if( M5.BtnUP.wasPressed()) ButtonTest("Btn UP Pressed");
|
||||
if( M5.BtnDOWN.wasPressed()) ButtonTest("Btn DOWN Pressed");
|
||||
if( M5.BtnMID.wasPressed()) ButtonTest("Btn MID Pressed");
|
||||
if( M5.BtnEXT.wasPressed()) ButtonTest("Btn EXT Pressed");
|
||||
if( M5.BtnPWR.wasPressed()){
|
||||
if (M5.BtnUP.wasPressed())
|
||||
ButtonTest("Btn UP Pressed"); // Scroll wheel up. 拨轮向上滚动
|
||||
if (M5.BtnDOWN.wasPressed())
|
||||
ButtonTest("Btn DOWN Pressed"); // Trackwheel scroll down. 拨轮向下滚动
|
||||
if (M5.BtnMID.wasPressed())
|
||||
ButtonTest("Btn MID Pressed"); // Dial down. 拨轮按下
|
||||
if (M5.BtnEXT.wasPressed())
|
||||
ButtonTest("Btn EXT Pressed"); // Top button press. 顶部按键按下
|
||||
if (M5.BtnPWR.wasPressed()) { // Right button press. 右侧按键按下
|
||||
ButtonTest("Btn PWR Pressed");
|
||||
M5.shutdown();
|
||||
M5.shutdown(); // Turn off the power, restart it, you need to wake up
|
||||
// through the PWR button.
|
||||
// 关闭电源,再次启动需要通过PWR按键唤醒
|
||||
}
|
||||
M5.update();
|
||||
M5.update(); // Refresh device button. 刷新设备按键
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ void testPage()
|
||||
|
||||
char wifiStrBuff[64];
|
||||
|
||||
Wire.begin(32,33,10000);
|
||||
Wire.begin(32,33,100000UL);
|
||||
int groveCheck = 0;
|
||||
|
||||
Wire.beginTransmission(0x76);
|
||||
|
||||
@@ -1,24 +1,36 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2021 by M5Stack
|
||||
* Equipped with CoreInk sample source code
|
||||
* 配套 CoreInk 示例源代码
|
||||
* Visit the website for more information:https://docs.m5stack.com/en/core/coreink
|
||||
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/coreink
|
||||
*
|
||||
* describe:Hello World
|
||||
* date:2021/11/14
|
||||
*******************************************************************************
|
||||
*/
|
||||
#include "M5CoreInk.h"
|
||||
|
||||
Ink_Sprite InkPageSprite(&M5.M5Ink);
|
||||
Ink_Sprite InkPageSprite(&M5.M5Ink); //创建 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();
|
||||
if( !M5.M5Ink.isInit())
|
||||
{
|
||||
Serial.printf("Ink Init faild");
|
||||
while (1) delay(100);
|
||||
}
|
||||
M5.M5Ink.clear();
|
||||
delay(1000);
|
||||
//creat ink refresh Sprite
|
||||
if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 )
|
||||
{
|
||||
Serial.printf("Ink Sprite creat faild");
|
||||
}
|
||||
InkPageSprite.drawString(35,50,"Hello World!");
|
||||
InkPageSprite.pushSprite();
|
||||
M5.begin(); //Initialize CoreInk. 初始化 CoreInk
|
||||
if( !M5.M5Ink.isInit()){ //check if the initialization is successful. 检查初始化是否成功
|
||||
Serial.printf("Ink Init faild");
|
||||
while (1) delay(100);
|
||||
}
|
||||
M5.M5Ink.clear(); //clear the screen. 清屏
|
||||
delay(1000);
|
||||
//creat ink Sprite. 创建图像区域
|
||||
if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 ){
|
||||
Serial.printf("Ink Sprite creat faild");
|
||||
}
|
||||
InkPageSprite.drawString(35,50,"Hello World!"); //draw string. 绘制字符串
|
||||
InkPageSprite.pushSprite(); //push the sprite. 推送图片
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2022 by M5Stack
|
||||
* Equipped with M5CoreInk sample source code
|
||||
* 配套 M5CoreInk 示例源代码
|
||||
* Visit the website for more
|
||||
information:https://docs.m5stack.com/en/app/scales_kit
|
||||
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/app/scales_kit
|
||||
*
|
||||
* describe: SCALES KIT WEIGHT UNIT EXAMPLE.
|
||||
* date:2022/02/23
|
||||
*******************************************************************************
|
||||
Connect WEIGHT UNIT to port A (G32/33)
|
||||
Calibration Instructions: Push the roller switch to tare up (0g calibration)
|
||||
when there is no load. Press the middle button of the wheel switch, push left
|
||||
and right to switch the standard weight value and put down the corresponding
|
||||
weight, and press the middle button of the wheel to confirm to calibrate.
|
||||
confirm for calibration.
|
||||
将WEIGHT UNIT连接至端口A(G32/33)
|
||||
校准说明:无负重情况下推动滚轮开关向上去皮重(0g 校准),
|
||||
按下滚轮开关中间按键,左右推动切换标准重量值并放下对应重量砝码,按下滚轮中间按键comfirm进行校准。
|
||||
Libraries:
|
||||
- [HX711](https://github.com/bogde/HX711)
|
||||
|
||||
*/
|
||||
|
||||
#include <M5CoreInk.h>
|
||||
#include <M5GFX.h>
|
||||
#include "HX711.h"
|
||||
|
||||
M5GFX display;
|
||||
M5Canvas canvas(&display);
|
||||
|
||||
// HX711 related pin Settings. HX711 相关引脚设置
|
||||
#define LOADCELL_DOUT_PIN 33
|
||||
#define LOADCELL_SCK_PIN 32
|
||||
|
||||
HX711 scale;
|
||||
|
||||
void setup() {
|
||||
M5.begin();
|
||||
|
||||
display.begin();
|
||||
|
||||
if (display.isEPD()) {
|
||||
display.setEpdMode(epd_mode_t::epd_fastest);
|
||||
display.invertDisplay(true);
|
||||
display.clear(TFT_BLACK);
|
||||
}
|
||||
if (display.width() < display.height()) {
|
||||
display.setRotation(display.getRotation() ^ 1);
|
||||
}
|
||||
|
||||
canvas.createSprite(display.width(), display.height());
|
||||
canvas.setTextDatum(MC_DATUM);
|
||||
canvas.setTextSize(1);
|
||||
canvas.setFont(&fonts::lgfxJapanGothic_16);
|
||||
canvas.drawString("Calibration sensor....", 100, 100);
|
||||
canvas.pushSprite(0, 0);
|
||||
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
|
||||
// The scale value is the adc value corresponding to 1g
|
||||
scale.set_scale(27.61f); // set scale
|
||||
scale.tare(); // auto set offset
|
||||
}
|
||||
|
||||
char info[100];
|
||||
|
||||
float last_weight = 0;
|
||||
|
||||
void loop() {
|
||||
float weight = scale.get_units(20) / 1000.0;
|
||||
if (weight != last_weight) {
|
||||
canvas.clear();
|
||||
canvas.setTextSize(1);
|
||||
canvas.drawString("press MID calibration mode", 100, 20);
|
||||
canvas.drawString("press EXT 0g calibration", 100, 40);
|
||||
canvas.setTextSize(2);
|
||||
if (weight >= 0) {
|
||||
Serial.printf("%.2f", weight);
|
||||
sprintf(info, "%.2f", weight);
|
||||
canvas.drawString(String(info) + "kg", 100, 100);
|
||||
} else {
|
||||
canvas.drawString("0.00kg", 100, 100);
|
||||
}
|
||||
canvas.pushSprite(0, 0);
|
||||
last_weight = weight;
|
||||
delay(500);
|
||||
}
|
||||
M5.update();
|
||||
if (M5.BtnEXT.wasPressed()) {
|
||||
canvas.clear();
|
||||
canvas.setTextSize(1);
|
||||
scale.tare();
|
||||
canvas.drawString("0g calibration!", 100, 100);
|
||||
canvas.pushSprite(0, 0);
|
||||
delay(500);
|
||||
}
|
||||
if (M5.BtnMID.wasPressed()) {
|
||||
long kg = 5;
|
||||
while (1) {
|
||||
M5.update();
|
||||
canvas.clear();
|
||||
canvas.setTextSize(1);
|
||||
canvas.drawString("calibration:" + String(kg) + "kg", 100, 100);
|
||||
canvas.drawString("press MID comfirm", 100, 20);
|
||||
canvas.drawString("press UP/DOWN change calibration value", 100,
|
||||
40);
|
||||
canvas.pushSprite(0, 0);
|
||||
if (M5.BtnDOWN.isPressed()) {
|
||||
kg--;
|
||||
}
|
||||
if (M5.BtnUP.isPressed()) {
|
||||
kg++;
|
||||
}
|
||||
if (M5.BtnMID.wasPressed()) {
|
||||
break;
|
||||
}
|
||||
delay(100);
|
||||
}
|
||||
long kg_adc = scale.read_average(20);
|
||||
kg_adc = kg_adc - scale.get_offset();
|
||||
scale.set_scale(kg_adc / (kg * 1000.0));
|
||||
canvas.drawString("Set Scale: " + String(kg_adc / (kg * 1000.0)), 100,
|
||||
100);
|
||||
canvas.pushSprite(0, 0);
|
||||
delay(500);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,18 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2021 by M5Stack
|
||||
* Equipped with CoreInk sample source code
|
||||
* 配套 CoreInk 示例源代码
|
||||
* Visit the website for more information:https://docs.m5stack.com/en/core/coreink
|
||||
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/coreink
|
||||
*
|
||||
* describe:RTC example. RTC示例
|
||||
* date:2021/11/14
|
||||
*******************************************************************************
|
||||
*/
|
||||
#include "M5CoreInk.h"
|
||||
|
||||
Ink_Sprite InkPageSprite(&M5.M5Ink);
|
||||
Ink_Sprite InkPageSprite(&M5.M5Ink); //创建 M5Ink实例
|
||||
|
||||
RTC_TimeTypeDef RTCtime;
|
||||
RTC_DateTypeDef RTCDate;
|
||||
@@ -8,46 +20,40 @@ RTC_DateTypeDef RTCDate;
|
||||
char timeStrbuff[64];
|
||||
|
||||
void flushTime(){
|
||||
M5.rtc.GetTime(&RTCtime);
|
||||
M5.rtc.GetDate(&RTCDate);
|
||||
|
||||
sprintf(timeStrbuff,"%d/%02d/%02d %02d:%02d:%02d",
|
||||
RTCDate.Year,RTCDate.Month,RTCDate.Date,
|
||||
RTCtime.Hours,RTCtime.Minutes,RTCtime.Seconds);
|
||||
|
||||
InkPageSprite.drawString(10,100,timeStrbuff);
|
||||
InkPageSprite.pushSprite();
|
||||
M5.rtc.GetTime(&RTCtime); //Get RTC time. 获取RTC时间
|
||||
M5.rtc.GetDate(&RTCDate); //Get RTC date. 获取RTC日期
|
||||
sprintf(timeStrbuff,"%d/%02d/%02d %02d:%02d:%02d",
|
||||
RTCDate.Year,RTCDate.Month,RTCDate.Date,
|
||||
RTCtime.Hours,RTCtime.Minutes,RTCtime.Seconds);
|
||||
InkPageSprite.drawString(10,100,timeStrbuff); //Draw time. 绘制时间
|
||||
InkPageSprite.pushSprite(); //push the sprite. 推送图片
|
||||
}
|
||||
|
||||
void setupTime(){
|
||||
|
||||
RTCtime.Hours = 23;
|
||||
RTCtime.Minutes = 33;
|
||||
RTCtime.Seconds = 33;
|
||||
M5.rtc.SetTime(&RTCtime);
|
||||
M5.rtc.SetTime(&RTCtime); //Set RTC time. 设置RTC时间
|
||||
|
||||
RTCDate.Year = 2020;
|
||||
RTCDate.Month = 11;
|
||||
RTCDate.Date = 6;
|
||||
M5.rtc.SetDate(&RTCDate);
|
||||
M5.rtc.SetDate(&RTCDate); //Set RTC date. 设置RTC日期
|
||||
}
|
||||
|
||||
void setup() {
|
||||
|
||||
M5.begin();
|
||||
if( !M5.M5Ink.isInit())
|
||||
{
|
||||
Serial.printf("Ink Init faild");
|
||||
while (1) delay(100);
|
||||
}
|
||||
M5.M5Ink.clear();
|
||||
delay(1000);
|
||||
//creat ink refresh Sprite
|
||||
if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 )
|
||||
{
|
||||
Serial.printf("Ink Sprite creat faild");
|
||||
}
|
||||
setupTime();
|
||||
M5.begin(); //Initialize CoreInk. 初始化 CoreInk
|
||||
if( !M5.M5Ink.isInit()){ //check if the initialization is successful. 检查初始化是否成功
|
||||
Serial.printf("Ink Init faild");
|
||||
while (1) delay(100);
|
||||
}
|
||||
M5.M5Ink.clear(); //clear the screen. 清屏
|
||||
delay(1000);
|
||||
//creat ink Sprite. 创建图像区域
|
||||
if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 ){
|
||||
Serial.printf("Ink Sprite creat faild");
|
||||
}
|
||||
setupTime();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
@@ -1,37 +1,45 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2021 by M5Stack
|
||||
* Equipped with CoreInk sample source code
|
||||
* 配套 CoreInk 示例源代码
|
||||
* Visit the website for more information:https://docs.m5stack.com/en/core/coreink
|
||||
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/coreink
|
||||
*
|
||||
* describe:RTC example. RTC示例
|
||||
* date:2021/11/14
|
||||
*******************************************************************************
|
||||
*/
|
||||
#include "M5CoreInk.h"
|
||||
|
||||
Ink_Sprite InkPageSprite(&M5.M5Ink);
|
||||
Ink_Sprite InkPageSprite(&M5.M5Ink); //创建 M5Ink实例
|
||||
|
||||
void setup()
|
||||
{
|
||||
M5.begin();
|
||||
digitalWrite(LED_EXT_PIN,LOW);
|
||||
if( !M5.M5Ink.isInit())
|
||||
{
|
||||
Serial.printf("Ink Init faild");
|
||||
while (1) delay(100);
|
||||
}
|
||||
M5.M5Ink.clear();
|
||||
delay(1000);
|
||||
//creat ink refresh Sprite
|
||||
if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 )
|
||||
{
|
||||
Serial.printf("Ink Sprite creat faild");
|
||||
}
|
||||
InkPageSprite.drawString(10,50,"Press PWR Btn for sleep");
|
||||
InkPageSprite.drawString(15,80,"after 5 sec wakeup.");
|
||||
InkPageSprite.pushSprite();
|
||||
void setup(){
|
||||
M5.begin(); //Initialize CoreInk. 初始化 CoreInk
|
||||
digitalWrite(LED_EXT_PIN,LOW); //设置 LED_EXT_PIN 为低电平
|
||||
if( !M5.M5Ink.isInit()){ //判断 M5Ink 是否初始化成功
|
||||
Serial.printf("Ink Init faild");
|
||||
while (1) delay(100);
|
||||
}
|
||||
M5.M5Ink.clear(); //clear the screen. 清屏
|
||||
delay(1000);
|
||||
//creat ink Sprite. 创建图像区域
|
||||
if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 ){
|
||||
Serial.printf("Ink Sprite creat faild");
|
||||
}
|
||||
InkPageSprite.drawString(10,50,"Press PWR Btn for sleep"); //在图像区域内绘制字符串
|
||||
InkPageSprite.drawString(15,80,"after 5 sec wakeup.");
|
||||
InkPageSprite.pushSprite(); //将图像区域内的内容推送到屏幕上
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
//Press PWR Btn for sleep , after 5 sec wakeup.
|
||||
if( M5.BtnPWR.wasPressed())
|
||||
{
|
||||
Serial.printf("Btn %d was pressed \r\n",BUTTON_PWR_PIN);
|
||||
M5.shutdown(5);
|
||||
//M5.shutdown(RTC_TimeTypeDef(10,2,0));
|
||||
}
|
||||
//M5.rtc.SetAlarmIRQ(RTC_TimeTypeDef(10,2,0));
|
||||
M5.update();
|
||||
void loop(){
|
||||
//Press PWR Btn for sleep , after 5 sec wakeup.
|
||||
//Press POWER Button for sleep, after 5 sec wake up.
|
||||
if( M5.BtnPWR.wasPressed()){
|
||||
Serial.printf("Btn %d was pressed \r\n",BUTTON_PWR_PIN);
|
||||
M5.shutdown(5); //Turn off the power and wake up the device through RTC after the delay of 5 seconds. 关闭电源,在延时5秒结束后通过RTC唤醒设备。
|
||||
//M5.shutdown(RTC_TimeTypeDef(10,2,0));
|
||||
}
|
||||
//M5.rtc.SetAlarmIRQ(RTC_TimeTypeDef(10,2,0));
|
||||
M5.update(); //Refresh device button. 刷新设备按键
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2022 by M5Stack
|
||||
* Equipped with M5CoreInk sample source code
|
||||
* 配套 M5CoreInk 示例源代码
|
||||
* Visit the website for more information:
|
||||
* 获取更多资料请访问:
|
||||
*
|
||||
* Please follow the steps below to add FastLED library:
|
||||
* - Arduino menu --> Manage Libraries... --> FastLED --> install
|
||||
* 在烧录前请按以下步骤添加 FastLED 库:
|
||||
* - Arduino menu --> Manage Libraries... --> FastLED --> install
|
||||
*
|
||||
* describe: KEY. 按键.
|
||||
* date: 2022/6/1
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <M5CoreInk.h>
|
||||
#include <FastLED.h>
|
||||
|
||||
Ink_Sprite InkPageSprite(&M5.M5Ink);
|
||||
|
||||
uint8_t ledColor = 0;
|
||||
|
||||
#define KEY_PIN 33 // Define Key Pin. 定义Key引脚
|
||||
#define DATA_PIN 32 // Define LED pin. 定义LED引脚.
|
||||
CRGB leds[1]; // Define the array of leds. 定义LED阵列.
|
||||
|
||||
void LED(void *parameter);
|
||||
void changeLedColor();
|
||||
|
||||
void setup() {
|
||||
M5.begin(); // Init M5Stack 初始化M5Stack
|
||||
M5.M5Ink.isInit(); // Init E-INK screen. 初始化E-INK屏幕驱动
|
||||
M5.M5Ink.clear();
|
||||
delay(1000);
|
||||
if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 ){ // creat ink refresh Sprite. 创建画布.
|
||||
Serial.printf("Ink Sprite creat faild");
|
||||
}
|
||||
else {
|
||||
Serial.printf("creatSprite success\n");
|
||||
}
|
||||
InkPageSprite.drawString(35,50,"UNIT-KEY Example");
|
||||
InkPageSprite.pushSprite();
|
||||
|
||||
pinMode(KEY_PIN, INPUT_PULLUP); // Init Key pin. 初始化Key引脚.
|
||||
|
||||
FastLED.addLeds<SK6812, DATA_PIN, GRB>(leds, 1); // Init FastLED. 初始化FastLED.
|
||||
|
||||
xTaskCreate(
|
||||
LED, "led", 1000, NULL, 0,
|
||||
NULL); // Create a thread for breathing LED. 创建一个线程用于LED呼吸灯.
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (!digitalRead(KEY_PIN)) { // If Key was pressed. 如果按键按下.
|
||||
changeLedColor(); // Change LED color. 更换LED呼吸灯颜色.
|
||||
while (!digitalRead(KEY_PIN)) // Hold until the key released. 在松开按键前保持状态.
|
||||
;
|
||||
}
|
||||
delay(100);
|
||||
}
|
||||
|
||||
void LED(void *parameter) {
|
||||
leds[0] = CRGB::Red;
|
||||
for (;;) {
|
||||
for (int i = 0; i < 255; i++) { // Set LED brightness from 0 to 255. 设置LED亮度从0到255.
|
||||
FastLED.setBrightness(i);
|
||||
FastLED.show();
|
||||
delay(5);
|
||||
}
|
||||
for (int i = 255; i > 0; i--) { // Set LED brightness from 255 to 0. 设置LED亮度从255到0.
|
||||
FastLED.setBrightness(i);
|
||||
FastLED.show();
|
||||
delay(5);
|
||||
}
|
||||
}
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
void changeLedColor() {
|
||||
ledColor++;
|
||||
if (ledColor > 2) ledColor = 0;
|
||||
switch (ledColor) { // Change LED colors between R,G,B. 在红绿蓝中切换LED颜色.
|
||||
case 0:
|
||||
leds[0] = CRGB::Red;
|
||||
break;
|
||||
case 1:
|
||||
leds[0] = CRGB::Green;
|
||||
break;
|
||||
case 2:
|
||||
leds[0] = CRGB::Blue;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2022 by M5Stack
|
||||
* Equipped with M5CoreInk sample source code
|
||||
* 配套 M5CoreInk 示例源代码
|
||||
* Visit the website for more information:
|
||||
* 获取更多资料请访问:
|
||||
*
|
||||
* describe: Limit.
|
||||
* date: 2022/6/1
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <M5CoreInk.h>
|
||||
|
||||
Ink_Sprite InkPageSprite(&M5.M5Ink);
|
||||
|
||||
#define KEY_PIN 33 // Define Limit Pin. 定义Limit连接引脚
|
||||
|
||||
void setup() {
|
||||
M5.begin(); // Init M5Stack 初始化M5Stack
|
||||
M5.M5Ink.isInit(); // Init E-INK screen. 初始化E-INK屏幕驱动
|
||||
M5.M5Ink.clear();
|
||||
delay(1000);
|
||||
if( InkPageSprite.creatSprite(0,0,200,200,true) != 0 ){ // creat ink refresh Sprite. 创建画布.
|
||||
Serial.printf("Ink Sprite creat faild");
|
||||
}
|
||||
else {
|
||||
Serial.printf("creatSprite success\n");
|
||||
}
|
||||
InkPageSprite.drawString(30,50,"UNIT-LIMIT Example");
|
||||
InkPageSprite.drawString(8,70,"Beep when limit was hit");
|
||||
InkPageSprite.pushSprite();
|
||||
|
||||
pinMode(KEY_PIN, INPUT_PULLUP); // Init Limit pin. 初始化Limit引脚.
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (!digitalRead(KEY_PIN)) { // If Limit was hit. 如果触碰了Limit.
|
||||
M5.Speaker.beep();
|
||||
} else {
|
||||
M5.Speaker.mute();
|
||||
}
|
||||
delay(100);
|
||||
}
|
||||
+2
-2
@@ -10,7 +10,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/m5stack/M5-CoreInk.git"
|
||||
},
|
||||
"version": "0.0.2",
|
||||
"framework": "arduino",
|
||||
"version": "0.0.5",
|
||||
"frameworks": "arduino",
|
||||
"platforms": "espressif32"
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
name=M5-CoreInk
|
||||
version=0.0.2
|
||||
version=0.0.5
|
||||
author=M5Stack
|
||||
maintainer=Hades<hades8363@gmail.com>
|
||||
sentence=Library for M5CoreInk development kit
|
||||
|
||||
+19
-1
@@ -13,6 +13,8 @@ int M5CoreInk::begin(bool InkEnable, bool wireEnable, bool SpeakerEnable)
|
||||
pinMode(POWER_HOLD_PIN, OUTPUT);
|
||||
digitalWrite(POWER_HOLD_PIN, HIGH); // Hold power
|
||||
|
||||
pinMode(1, OUTPUT);
|
||||
|
||||
pinMode(LED_EXT_PIN, OUTPUT);
|
||||
|
||||
Serial.begin(115200);
|
||||
@@ -20,7 +22,7 @@ int M5CoreInk::begin(bool InkEnable, bool wireEnable, bool SpeakerEnable)
|
||||
|
||||
if (wireEnable)
|
||||
{
|
||||
Wire.begin(32, 33, 10000);
|
||||
Wire.begin(32, 33, 100000UL);
|
||||
}
|
||||
|
||||
if (SpeakerEnable)
|
||||
@@ -58,6 +60,10 @@ void M5CoreInk::update()
|
||||
void M5CoreInk::shutdown()
|
||||
{
|
||||
M5Ink.deepSleep();
|
||||
|
||||
pinMode(1, OUTPUT);
|
||||
digitalWrite(1, LOW);
|
||||
|
||||
digitalWrite(POWER_HOLD_PIN, LOW);
|
||||
}
|
||||
int M5CoreInk::shutdown(int seconds)
|
||||
@@ -66,6 +72,10 @@ int M5CoreInk::shutdown(int seconds)
|
||||
rtc.clearIRQ();
|
||||
rtc.SetAlarmIRQ(seconds);
|
||||
delay(10);
|
||||
|
||||
pinMode(1, OUTPUT);
|
||||
digitalWrite(1, LOW);
|
||||
|
||||
digitalWrite(POWER_HOLD_PIN, LOW);
|
||||
return 0;
|
||||
}
|
||||
@@ -75,6 +85,10 @@ int M5CoreInk::shutdown(const RTC_TimeTypeDef &RTC_TimeStruct)
|
||||
rtc.clearIRQ();
|
||||
rtc.SetAlarmIRQ(RTC_TimeStruct);
|
||||
delay(10);
|
||||
|
||||
pinMode(1, OUTPUT);
|
||||
digitalWrite(1, LOW);
|
||||
|
||||
digitalWrite(POWER_HOLD_PIN, LOW);
|
||||
return 0;
|
||||
}
|
||||
@@ -84,6 +98,10 @@ int M5CoreInk::shutdown(const RTC_DateTypeDef &RTC_DateStruct, const RTC_TimeTyp
|
||||
rtc.clearIRQ();
|
||||
rtc.SetAlarmIRQ(RTC_DateStruct,RTC_TimeStruct);
|
||||
delay(10);
|
||||
|
||||
pinMode(1, OUTPUT);
|
||||
digitalWrite(1, LOW);
|
||||
|
||||
digitalWrite(POWER_HOLD_PIN, LOW);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user