ricmoo / QRCode

QR code generation library in C, optimized for low-power devices, such as Arduino.
Other
647 stars 204 forks source link

Missing Alignment and finder patterns #42

Open Nafihahmd opened 4 months ago

Nafihahmd commented 4 months ago

I am using the library to plot the QR code on an monochrome 8 bit lcd display. I am able to plot the QR directly from the buffer. The code I am using is as below:


#define __width 41
#define __height 41
#define __input_size (__width +7)/8 * __width

....

int main() {
// The structure to manage the QR code
QRCode qrcode;

// Allocate a chunk of memory to store the QR code
uint8_t qrcodeBytes[qrcode_getBufferSize()];

qrcode_initText(&qrcode, qrcodeBytes, 3, ECC_LOW, "HELLO WORLD");
 ...
  for(int i=0; i<__input_size; i++){
      LCD_putByte(qrcodeBytes[i]);
     }
...
}

But the resulting QR code is not scannable and lacks finder/alignment patterns. Any guess why?

Thanks in advance