当前位置:网站首页>Two dimensional code generation based on MCU and two dimensional code display on ink screen
Two dimensional code generation based on MCU and two dimensional code display on ink screen
2022-07-27 22:33:00 【iot-lorawan】
Ink screen compared with others LCD The screen has a significant advantage in low power consumption , It is especially suitable for button battery or even battery free nfc Application of price tag . Price tags often display QR codes , So I found a suitable one on the Internet mcu QR code generation library for use on .
This qrcode It's very suitable for mcu On , Just one .c and .h file .
Usage flow :
// Create the QR code Generate the corresponding QR code according to the required string
QRCode qrcode;
uint8_t qrcodeData[qrcode_getBufferSize(3)];
qrcode_initText(&qrcode, qrcodeData, 3, 0, "https://blog.csdn.net/hydfxy2018");
printf( "qrcode.size:%d\r\n", qrcode.size);qrcode_getBufferSize(3) Parameters here 3 On behalf of the use of qr version3, The resolution of QR code generated by different versions is different .
Version | Size | Error Correction | Mode | ||
|---|---|---|---|---|---|
| Numeric | Alphanumeric | Byte | |||
| 1 | 21 x 21 | LOW | 41 | 25 | 17 |
| MEDIUM | 34 | 20 | 14 | ||
| QUARTILE | 27 | 16 | 11 | ||
| HIGH | 17 | 10 | 7 | ||
| 2 | 25 x 25 | LOW | 77 | 47 | 32 |
| MEDIUM | 63 | 38 | 26 | ||
| QUARTILE | 48 | 29 | 20 | ||
| HIGH | 34 | 20 | 14 | ||
| 3 | 29 x 29 | LOW | 127 | 77 | 53 |
| MEDIUM | 101 | 61 | 42 | ||
| QUARTILE | 77 | 47 | 32 | ||
| HIGH | 58 | 35 | 24 | ||
This part is in qrcode There are instructions in the warehouse , According to the above, you can choose the appropriate version and the corresponding ecc Set up .
The generated QR code is displayed on the ink screen
for (uint8_t y = 0; y < qrcode.size; y++) {
for (uint8_t x = 0; x < qrcode.size; x++) {
if (qrcode_getModule(&qrcode, x, y)) {
Paint_DrawFillRect(0 + x * 3,
150 + y * 3, 3, 3);
}
}
}The principle is based on two-dimensional code code Dot display on the screen , Here, you can also adjust the size of the actual QR code through the size of the point , Press each point as above 3 Pixel setting .
The display effect is as follows :

The complete code reference is as follows :
GitHub - iot-lorawan/MCU_QRCode_LCD: Ink-Display with QRCode in MCU
边栏推荐
- 【二叉树】统计二叉树中好节点的数目
- Polarization relay
- CMOS传输门原理及应用
- redis学习
- Chapter 8 using web sessions through rest
- Optocoupler relay
- Learn the use principle and core idea of thread pool from the source code
- Relationship between DBM and VPP and Vpeak
- Tab bar (addeventlistener and onclick practice, used with bind method, exponential growth to listen for events)
- Leetcode 301. delete invalid parentheses
猜你喜欢

7行代码让B站崩溃3小时

Matlab draws the statistical rose chart of wind speed and direction

C language output teaching calendar

Vocational school Panyun network security competition ----- exploration of hidden information

每条你收藏的资讯背后,都离不开TA

matlab 绘制三坐标(轴)图

ThreadLocal principle and source code analysis (click in step by step, don't recite, learn ideas)

If demand splitting is as simple as cutting a cake | agile practice

Time relay

leetcode15--三数之和
随机推荐
A lock faster than read-write lock. Don't get to know it quickly
Cocos: simple application of ccpdistance function and the function of eyeball rotating in orbit with fingers
Drawing three coordinate (axis) diagram with MATLAB
An2021软件安装及基本操作(新建文件/导出)
CMOS switch (II)_ Parameter extraction
What is modcount in the source code? What's the effect
matlab 绘制三坐标(轴)图
Leetcode-199-right view of binary tree
Are Transformers Effective for Time Series Forecasting?|填坑
Time relay
Window localStorage 属性和Location 对象
Mimx8md6cvahzab i.MX 8mdual cortex-a53 - Microprocessor
Hill sort of seven sorts
8000字讲透OBSA原理与应用实践
Kubernetes二进制部署——理论部分
Leetcode-155-minimum stack
Leetcode-538- convert binary search tree to cumulative tree
全国职业院校技能竞赛网络安全竞赛数据取证与分析思路分析
Project management tool Zen
SSM整合流程