#include <WiFi.h>
#include <HTTPClient.h>
#include <Adafruit_GFX.h>
#include <Fonts/FreeSans18pt7b.h>
#include <Fonts/FreeSansBold18pt7b.h>
#include <Fonts/FreeSansBold24pt7b.h>
#include <Adafruit_ILI9341.h>
const char* ssid = "Wokwi-GUEST";
const char* password = "";
#define TFT_DC 2
#define TFT_CS 15
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
const unsigned char Bus48 PROGMEM [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x3F,
0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x01, 0xFF, 0xC0, 0x03, 0xFF, 0x80, 0x01, 0xFF, 0xC0, 0x03, 0xFF, 0x80, 0x03, 0xFF, 0xC0, 0x03,
0xFF, 0xC0, 0x03, 0xFF, 0xC0, 0x03, 0xFF, 0xC0, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xFF, 0xFF, 0xC0, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0,
0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0x0F, 0xC0, 0x03, 0xC0,
0x03, 0xF0, 0x0F, 0xC0, 0x03, 0xC0, 0x03, 0xF0, 0x0F, 0xC0, 0x03, 0xC0, 0x03, 0xF0, 0x0F, 0xC0,
0x03, 0xC0, 0x03, 0xF0, 0x0F, 0xC0, 0x03, 0xC0, 0x03, 0xF0, 0x0F, 0xC0, 0x03, 0xC0, 0x03, 0xF0,
0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xFF, 0xFF, 0xFF,
0xFF, 0xC0, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xFF, 0xFF, 0xC0, 0x03, 0xE1, 0xFF, 0xFF, 0x87, 0xC0, 0x03, 0xC0, 0xFF, 0xFF, 0x03, 0xC0,
0x03, 0xC0, 0xFF, 0xFF, 0x03, 0xC0, 0x03, 0xC0, 0xFF, 0xFF, 0x03, 0xC0, 0x03, 0xC0, 0xFF, 0xFF,
0x03, 0xC0, 0x03, 0xE1, 0xFF, 0xFF, 0x87, 0xC0, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x03, 0xFF,
0xFF, 0xFF, 0xFF, 0xC0, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x00, 0xFC, 0x00, 0x00, 0x3F, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x3F, 0x00, 0x00, 0xFC, 0x00, 0x00,
0x3F, 0x00, 0x00, 0x78, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
void setup() {
// WiFi.begin(ssid, password, 6);
tft.begin();
tft.setRotation(1);
// tft.setTextColor(ILI9341_WHITE);
//tft.print("Connecting to WiFi");
//while (WiFi.status() != WL_CONNECTED) {
// delay(100);
// tft.print(".");
// }
// tft.print("\nOK! IP=");
// tft.println(WiFi.localIP());
tft.fillScreen(ILI9341_WHITE);
tft.fillRect(0, 0, 320, 80, 0x7882); // Maroon
tft.fillRect(0, 80, 320, 8, 0xDAA520); // Gold
tft.drawBitmap(25, 14, Bus48, 48, 48, ILI9341_WHITE); // Bus icon
tft.setCursor(88, 43);
tft.setTextColor(ILI9341_WHITE);
tft.setFont(&FreeSansBold18pt7b);
tft.println("Departures");
tft.fillRect(0,163,320,2,0x7882); // Horizontal dividing line between bus times
tft.setTextColor(ILI9341_BLACK);
tft.setFont(&FreeSansBold24pt7b); // Display bus numbers
tft.setCursor(25, 141);
tft.println("5");
tft.setCursor(25, 216);
tft.println("16");
Serial.println("Where is the serial monitor stuff displayed?");
}
void loop() {
tft.setFont(&FreeSans18pt7b);
tft.fillRect(110,90,210,70,ILI9341_WHITE); // Draw white box to overwrite last bus times
tft.setCursor(115, 137);
tft.println("12 / 26 min"); // Bus times
tft.fillRect(110,166,210,70,ILI9341_WHITE);
tft.setCursor(115, 212);
tft.println("due / 19 min");
delay(5000);
}
// https://learn.adafruit.com/adafruit-gfx-graphics-library/graphics-primitives
// Bitmaps draw with origin at their top left
// Text draws with origin at its bottom left
// Colour picker: https://barth-dev.de/online/rgb565-color-picker/