ESP_QRcode icon indicating copy to clipboard operation
ESP_QRcode copied to clipboard

'QRCode' does not declared in this scope

Open psbpsb opened this issue 1 year ago • 0 comments

#include "qrcode.h"

void setup() { Serial.begin(115200);

// Start time
uint32_t dt = millis();

// Create the QR code
QRCode qrcode;
uint8_t qrcodeData[qrcode_getBufferSize(3)];
qrcode_initText(&qrcode, qrcodeData, 3, 0, "HELLO WORLD");

// Delta time
dt = millis() - dt;
Serial.print("QR Code Generation Time: ");
Serial.print(dt);
Serial.print("\n");

// Top quiet zone
Serial.print("\n\n\n\n");

for (uint8_t y = 0; y < qrcode.size; y++) {

    // Left quiet zone
    Serial.print("        ");

    // Each horizontal module
    for (uint8_t x = 0; x < qrcode.size; x++) {

        // Print each module (UTF-8 \u2588 is a solid block)
        Serial.print(qrcode_getModule(&qrcode, x, y) ? "\u2588\u2588": "  ");

    }

    Serial.print("\n");
}

// Bottom quiet zone
Serial.print("\n\n\n\n");

}

void loop() {

}

ERROR: C:\Users\AALROOT\AppData\Local\Temp.arduinoIDE-unsaved2023830-5036-ms8jta.fcjta\sketch_sep30a\sketch_sep30a.ino: In function 'void setup()': C:\Users\AALROOT\AppData\Local\Temp.arduinoIDE-unsaved2023830-5036-ms8jta.fcjta\sketch_sep30a\sketch_sep30a.ino:11:5: error: 'QRCode' was not declared in this scope QRCode qrcode; ^~~~~~ C:\Users\AALROOT\AppData\Local\Temp.arduinoIDE-unsaved2023830-5036-ms8jta.fcjta\sketch_sep30a\sketch_sep30a.ino:12:24: error: 'qrcode_getBufferSize' was not declared in this scope uint8_t qrcodeData[qrcode_getBufferSize(3)]; ^~~~~~~~~~~~~~~~~~~~ C:\Users\AALROOT\AppData\Local\Temp.arduinoIDE-unsaved2023830-5036-ms8jta.fcjta\sketch_sep30a\sketch_sep30a.ino:13:22: error: 'qrcode' was not declared in this scope qrcode_initText(&qrcode, qrcodeData, 3, 0, "HELLO WORLD"); ^~~~~~ C:\Users\AALROOT\AppData\Local\Temp.arduinoIDE-unsaved2023830-5036-ms8jta.fcjta\sketch_sep30a\sketch_sep30a.ino:13:30: error: 'qrcodeData' was not declared in this scope qrcode_initText(&qrcode, qrcodeData, 3, 0, "HELLO WORLD"); ^~~~~~~~~~ C:\Users\AALROOT\AppData\Local\Temp.arduinoIDE-unsaved2023830-5036-ms8jta.fcjta\sketch_sep30a\sketch_sep30a.ino:13:5: error: 'qrcode_initText' was not declared in this scope qrcode_initText(&qrcode, qrcodeData, 3, 0, "HELLO WORLD"); ^~~~~~~~~~~~~~~ C:\Users\AALROOT\AppData\Local\Temp.arduinoIDE-unsaved2023830-5036-ms8jta.fcjta\sketch_sep30a\sketch_sep30a.ino:13:5: note: suggested alternative: 'qrcode_display' qrcode_initText(&qrcode, qrcodeData, 3, 0, "HELLO WORLD"); ^~~~~~~~~~~~~~~ qrcode_display C:\Users\AALROOT\AppData\Local\Temp.arduinoIDE-unsaved2023830-5036-ms8jta.fcjta\sketch_sep30a\sketch_sep30a.ino:33:26: error: 'qrcode_getModule' was not declared in this scope Serial.print(qrcode_getModule(&qrcode, x, y) ? "\u2588\u2588": " "); ^~~~~~~~~~~~~~~~ C:\Users\AALROOT\AppData\Local\Temp.arduinoIDE-unsaved2023830-5036-ms8jta.fcjta\sketch_sep30a\sketch_sep30a.ino:33:26: note: suggested alternative: 'esp_qrcode_get_module' Serial.print(qrcode_getModule(&qrcode, x, y) ? "\u2588\u2588": " "); ^~~~~~~~~~~~~~~~ esp_qrcode_get_module

exit status 1

Compilation error: 'QRCode' was not declared in this scope

HOW TO SOLVE THIS PROBLEM?

psbpsb avatar Sep 30 '23 06:09 psbpsb