You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The qr codes generated and displayed on a 320x480 TFT / Arduino MEGA can be scanned using an average qr-code scanner app, up to type 9. Using type 10 or higher, the app does not scan the code.
qrcode_initText retruns 0 (zero). Seems to be ok.
See code below, including the output: type 9 is working and type 10 is not working
Not sure if it is something I did wrong, or any other reason.
Help is greatly appreciated!
Kind regards
#include "qrcode.h"
#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0
#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin
#include <SPI.h> // f.k. for Arduino-1.5.2
#include "Adafruit_GFX.h"// Hardware-specific library
#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;
#define BLACK 0x0000
#define WHITE 0xFFFF
void setup() {
int qr_return;
// Create the QR code
QRCode qrcode;
uint8_t qrcodeData9[qrcode_getBufferSize(9)];
qrcode_initText(&qrcode, qrcodeData9, 9, 0, "https://a.nl?b=HelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHel0123456789");
uint16_t ID = tft.readID(); //
tft.begin(ID);
tft.fillScreen(WHITE);
uint8_t qr_size = 5;
uint8_t qr_top = 20;
uint8_t qr_left = (320 / 2) - int((qrcode.size * qr_size) / 2); // Center
// Each line of modules
for (uint8_t y = 0; y < qrcode.size; y++) {
// Each horizontal module
for (uint8_t x = 0; x < qrcode.size; x++) {
if (qrcode_getModule(&qrcode, x, y)) {
tft.fillRect(qr_left + (qr_size * x), qr_top + (qr_size * y), qr_size, qr_size, BLACK);
}
}
}
uint8_t qrcodeData10[qrcode_getBufferSize(10)];
qrcode_initText(&qrcode, qrcodeData10, 10, 0, "https://a.nl?b=HelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHel0123456789");
qr_left = (320 / 2) - int((qrcode.size * qr_size) / 2); // Center
tft.fillScreen(WHITE);
// Each line of modules
for (uint8_t y = 0; y < qrcode.size; y++) {
// Each horizontal module
for (uint8_t x = 0; x < qrcode.size; x++) {
if (qrcode_getModule(&qrcode, x, y)) {
tft.fillRect(qr_left + (qr_size * x), qr_top + (qr_size * y), qr_size, qr_size, BLACK);
}
}
}
}
void loop() {
}
Type 9 is working
Type 10 is not working
The text was updated successfully, but these errors were encountered:
Status: Solved
Within function getModeBits() in qrcode.c
Change unsigned int modeInfo = 0x7bbb80a;
Into unsigned long modeInfo = 0x7bbb80a;
To avoid truncation of 0x7bbb80a.
To reproduce: use the int and compile with warning level high or 'all'. @ricmoo or @per1234 could you please solve this bug in the library?
Regards
The qr codes generated and displayed on a 320x480 TFT / Arduino MEGA can be scanned using an average qr-code scanner app, up to type 9. Using type 10 or higher, the app does not scan the code.
qrcode_initText retruns 0 (zero). Seems to be ok.
See code below, including the output: type 9 is working and type 10 is not working
Not sure if it is something I did wrong, or any other reason.
Help is greatly appreciated!
Kind regards
Type 9 is working
Type 10 is not working
The text was updated successfully, but these errors were encountered: