Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@betterengineering
Copy link
Contributor

@betterengineering betterengineering commented Jul 11, 2022

Overview

We want to create apps that include QR codes and wanted to offer a better experience then embedding an image. This change adds a new module, qrcode that allows for generating QR codes that look great on the display.

Notes on QR Codes

  • QR Codes have version numbers, which roughly equates to the size of the code in terms of modules
  • A module is a 1x1 square, so for us a module is a pixel
  • Versions are from 1-40. We can use the following versions on a Tidbyt:
    • 1 == 21x21
    • 2 == 25x25
    • 3 == 29x29
  • One gotcha is that lower version numbers also can contain less data. This becomes a problem if a users wants to include large URLs in small QRCodes without shortening them
  • QRCodes have a an error correction feature, which is useful in environments like a paper menu when there might be smudges, etc.
    • Because we're using small QRCodes, we can't support a super high level of error correction without sacrificing the length of URL we have

Changes

  • modules: Add QRCode module.
    • This commit adds a module to generate QR codes to pixlet! This native QR code integration can be used to create promotional apps.

Example

load("render.star", "render")
load("qrcode.star", "qrcode")

def main(config):
    code = qrcode.generate(
        url = "https://tidbyt.com?utm_source=pixlet_example",
        size = "large",
        color = "#fff",
        background = "#000",
    )

    return render.Root(
        child = render.Padding(
            child = render.Image(src = code),
            pad = 1,
        ),
    )

This commit adds a module to generate QR codes to pixlet! This native QR
code integration can be used to create promotional apps.
@betterengineering betterengineering merged commit bf90fbb into main Jul 11, 2022
@betterengineering betterengineering deleted the mark/qr-code branch July 11, 2022 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants