Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stepansnigirev/mpy-qrencode
micropython module to generate qr codes
https://github.com/stepansnigirev/mpy-qrencode
Last synced: 8 days ago
JSON representation
micropython module to generate qr codes
- Host: GitHub
- URL: https://github.com/stepansnigirev/mpy-qrencode
- Owner: stepansnigirev
- Created: 2019-08-09T13:05:14.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-08-09T13:06:30.000Z (over 5 years ago)
- Last Synced: 2024-11-09T05:38:22.437Z (2 months ago)
- Language: C
- Size: 11.7 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mpy-qrencode
A micropython binding to qr code generation.
Add `#define MODULE_QRENCODE_ENABLED (1)` in your `mpconfigport.h`.
Example:
```py
import m5stack
from m5stack import LCD, fonts, color565
import qrencodelcd = LCD()
lcd.set_color(color565(0,50,250), color565(255,255,255)) # text color, background color
lcd.erase()def run(x0=0, y0=0, data="some text here"):
s = qrencode.make(data).decode('utf-8')
arr = s.split('\n')
y = y0
color = color565(0,0,0)
for l in arr:
y = y + 1
x = x0
for b in l:
x = x + 1
if b == '\x01':
lcd.pixel(x,y,color)
```