#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#define TFT_DC PB7
#define TFT_CS PB6
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
void setup() {
Serial.begin(115200);
Serial.println("Wokwi Blue Pill SPI Demo Starting...");
tft.begin();
drawMenu();
}
void loop() {
// Here you would check for user input (e.g., button presses)
// and refresh the menu or take actions based on the input.
// This example just redraws the menu every 5 seconds for demonstration.
delay(5000);
drawMenu();
}
void drawMenu() {
tft.fillScreen(ILI9341_BLACK);
tft.setCursor(10, 20);
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(2);
tft.println("Menu:");
tft.setTextColor(ILI9341_YELLOW);
tft.setTextSize(1);
tft.setCursor(20, 50);
tft.println("1. What is in stock");
tft.setCursor(20, 70);
tft.println("2. Get location by RFID");
tft.setCursor(20, 90);
tft.println("3. Add item");
tft.setCursor(20, 110);
tft.println("4. Remove item by ID");
tft.setCursor(20, 130);
tft.println("5. Detail");
}