当前位置:网站首页>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
边栏推荐
- Reed relay
- JVM garbage collection garbage collector and common combination parameters
- SQL injection less29 (parameter pollution bypasses WAF)
- SQL injection less26a (Boolean blind injection)
- An2021软件安装及基本操作(新建文件/导出)
- 九天后我们一起,聚焦音视频、探秘技术新发展
- 舌簧继电器
- Project management tool Zen
- Excel only wants to visualize charts and make data move? Yes, come and watch (with a large number of templates to download)
- Credit default prediction based on simplified scorecard, smote sampling and random forest
猜你喜欢
随机推荐
Nodejs npm常用指令总结
What is modcount in the source code? What's the effect
Leetcode-309- best time to buy and sell stocks, including freezing period
Cocos: simple application of ccpdistance function and the function of eyeball rotating in orbit with fingers
matlab 绘制三坐标(轴)图
Are Transformers Effective for Time Series Forecasting?| Pit filling
A lock faster than read-write lock. Don't get to know it quickly
What is private traffic?
Learn the use principle and core idea of thread pool from the source code
The execution process, orphan process and zombie process of fork() function
Live broadcast software app development, uniapp scroll view hidden scroll bar
Cloud native microservices Chapter 3: haproxy+kept
How to customize logging of.Net6.0
HC32F4A0 时钟控制
How to buy stocks on mobile phones? Is it safe to open an account
Uniswap集成sudoswap,能否拉开NFT流动性新序幕?
Reentranlock and source code analysis (learn ideas and click the source code step by step)
Hill sort of seven sorts
ApacheSpark-命令执行(CVE-2022-33891) 漏洞复现
8000 word explanation of OBSA principle and application practice









