#include <qrcode.h>
// #include <Arduino.h>
QRCode qrcode;
uint8_t qrcodeData[qrcode_getBufferSize(3)]; // Adjust this to your QR code size
void setup() {
Serial.begin(115200);
Serial.println("Hello, ESP32-S3!");
// Generate 64 random bytes
uint8_t data[64];
for (int i = 0; i < 64; i++) {
data[i] = random(0, 256); // Generating random bytes
}
// Initialize the QR code (3 represents a version that can hold up to 64 bytes of data)
qrcode_initText(&qrcode, qrcodeData, 3, ECC_LOW, (const char*)data);
// Print the QR code to the serial monitor
for (int y = 0; y < qrcode.size; y++) {
for (int x = 0; x < qrcode.size; x++) {
Serial.print(qrcode_getModule(&qrcode, x, y) ? "##" : " ");
}
Serial.println();
}
}
void loop() {
delay(10000); // Slow down the loop so the QR code is printed once
}