当前位置:网站首页>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
边栏推荐
- [untitled]
- 【OBS】P B 丢帧阈值 buffer_duration_usec
- The gratitude and resentment between the four swordsmen and code review: "abandon all chaos" to "prodigal son returns"
- 2022 / July daily report
- Matlab 绘制风速、风向统计玫瑰花图
- 7行代码让B站崩溃3小时
- 8000 word explanation of OBSA principle and application practice
- 项目分析(哪些是it培训给不了)
- Learn the use principle and core idea of thread pool from the source code
- Project analysis (from technology to project and product)
猜你喜欢

舌簧继电器

电磁继电器

Deepfake's face is hard to distinguish between true and false, and musk Fenke has disguised successfully

An2021软件安装及基本操作(新建文件/导出)
![[untitled]](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[untitled]

Inventory Poka ecological potential project | cross chain characteristics to promote the prosperity of multi track

When type= 'number' is set in the input field, remove the up and down buttons behind it

Reentranlock and source code analysis (learn ideas and click the source code step by step)

vs2019 release模式调试:此表达式有副作用,将不予计算。

Behind every piece of information you collect, you can't live without TA
随机推荐
Deepfake's face is hard to distinguish between true and false, and musk Fenke has disguised successfully
RN search highlight
[stonedb fault diagnosis] system resource bottleneck diagnosis
How to quickly pass the probation period for newly trained intermediate test engineers
Solid state relay
STM32 project Sharing -- mqtt intelligent access control system (including app control)
dBm和Vpp以及Vpeak的关系
Leetcode-39-total number of combinations
Leetcode383 ransom letter
SQL injection less29 (parameter pollution bypasses WAF)
leetcode15--三数之和
Polarization relay
Learn the use principle and core idea of thread pool from the source code
Drawing three coordinate (axis) diagram with MATLAB
高频继电器
electromagnetic relay
全国职业院校技能竞赛网络安全竞赛数据取证与分析思路分析
直播app系统源码,上下叠层样式的轮播图
Matlab draws the statistical rose chart of wind speed and direction
QT常见操作合集