#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <qrcode.h>
#define TFT_CS 10
#define TFT_DC 9
#define TFT_RST 8
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
String actualItems[][2] = {
{"Item 1", "100"},
{"Item 2", "200"},
{"Item 3", "300"},
{"Item 4", "400"}
};
String qrLink = "https://ieee.msit.in/";
int lastX, lastY;
void setup() {
Serial.begin(9600);
tft.begin();
tft.setRotation(1);
tft.fillScreen(0xc75f);
QRCode qrcode;
uint8_t qrcodeData[qrcode_getBufferSize(3)];
int sum = 0;
for (int i = 0; i < 4; i++) {
sum += actualItems[i][1].toInt();
}
tft.fillRoundRect(80, 70 ,165, 160,5, ILI9341_WHITE);
qrcode_initText(&qrcode, qrcodeData, 3, 0, (qrLink).c_str());
for (uint8_t y = 0; y < qrcode.size; y++) {
for (uint8_t x = 0; x < qrcode.size; x++) {
if (qrcode_getModule(&qrcode, x, y)) {
tft.fillRect(90 + x * 5, 80 + y * 5, 5, 5, ILI9341_BLACK);
}
lastX = 90 + x * 5;
}
lastY = 80 + y * 5;
}
tft.setTextColor(ILI9341_BLACK);
tft.setCursor(60,10);
tft.setTextSize(2);
tft.fillRect(0, 0 ,tft.width(), 60, ILI9341_WHITE);
tft.println("Welcome TO IEEE");
tft.setCursor(40,40);
tft.setTextSize(2);
tft.println("Scan & Visit Website");
}
void loop() {
delay(10);
}