1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-21 06:53:01 +08:00
lvgl/examples/libs/qrcode/lv_example_qrcode_1.py
Uli Raich cd197a8e49
feat(examples) add micropython versions of the external library examples (#2762)
Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com>
2021-11-24 21:18:15 -05:00

16 lines
404 B
Python
Executable File

#!/opt/bin/lv_micropython -i
import lvgl as lv
import display_driver
bg_color = lv.palette_lighten(lv.PALETTE.LIGHT_BLUE, 5)
fg_color = lv.palette_darken(lv.PALETTE.BLUE, 4)
qr = lv.qrcode(lv.scr_act(), 150, fg_color, bg_color)
# Set data
data = "https://lvgl.io"
qr.update(data,len(data))
qr.center()
# Add a border with bg_color
qr.set_style_border_color(bg_color, 0)
qr.set_style_border_width(5, 0)