// STM32 Blue Pill SPI LCD Example
// Simulation: https://wokwi.com/projects/374780854731040769
#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);
int flow=20;
int press=100;
int valve=100;
int counter=0;
byte on = 0;
byte gpm = 0;
void setup() {
tft.begin();
tft.setTextColor(ILI9341_CYAN);
tft.setTextSize(2);
tft.setCursor(0, 30);
tft.print(" Flow : ");
int temp = flow * 26;
tft.print(temp/100);
tft.print(".");
tft.print(temp/10);
tft.print(temp%10);
//tft.print(flow*26);
tft.println(" GPM");
tft.println();
tft.setTextColor(ILI9341_GREEN);
tft.setCursor(0, 60);
tft.print(" Pressure: ");
tft.print(press);
tft.println(" psi");
tft.println();
tft.setTextColor(ILI9341_WHITE);
tft.setCursor(0, 90);
tft.print(" Valve : ");
tft.print(valve);
tft.println(" %");
tft.fillCircle(120, 200, 40, ILI9341_WHITE);
tft.fillCircle(120, 200, 35, ILI9341_RED);
tft.setCursor(105, 195);
tft.setTextColor(ILI9341_BLACK);
tft.print("OFF");
}
void loop() {
}