P2QR

P2 QR Code Generator
Share this object
<

Overview

Content

This is a P2 QR Code generator based on the work of B.J. Guillot's qr and Vzaa's C90 fork named qrwpa. It outputs to the SEND() method and supports ASCII, ANSI, UNICODE, custom characters or will output to SSD1331. Additionally, there is a debug output.

Some things of note about this code:

  • Hard-coded to use Quality Mode "Q" (QR has Low, Medium, "Q", and High Error Correction, Q is the 2nd best). Felt "Q" ("Medium-High") was the best compromise.
  • Hard-coded to use encoding scheme for 8-bit byte data (QR has numeric-only, alphanumeric-only, Byte, and Kanji). Felt Byte was the most useful.
  • Hard-coded to use Mask 1 (the bits of every even row are flipped). This is probably a bad thing and is against the QR specification.
    You are supposed to try each of the 8 available mask types, calculate a "penalty score" for each mask, and then, for the final rendering, use the mask that had the lowest penalty. The penalty is based on number of consecutive blocks having same color, etc.
    It's designed to make it easier on scanning equipment. In reality, I don't think it matters everything generated by this code should be a valid QR, it may just not be the "best" QR possible.
    SSD1331

Downloads  
Zip archive download

Leave a Reply