/* contents : bitmaps.h: setupwndw (the window on setup), ldscrn (boot screen), setupscrn (setup background), cntbtn (continue button)
functions.cpp: DrawSetupBox(); , DrawSetupBackground(); , ClearSetupBox(); , ClearProgress(); , DrawLoadScreen(); */
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <Adafruit_FT6206.h>
#include <SPI.h>
#include "bitmaps.h"
#include "functions.h"
Adafruit_ILI9341 tft = Adafruit_ILI9341(15, 2, 4); // CS, DC, RST
int cuh = 0;
int cuh2 = 0;
void setup() {
Serial.begin(9600);
Serial.println("lil broski");
tft.begin();
tft.setSPISpeed(40000000);
tft.setRotation(1);
tft.fillScreen(ILI9341_BLACK);
// Load splash screen and boot messages
DrawLoadScreen();
tft.setCursor(1, 148);
tft.setTextSize(1);
tft.setTextColor(ILI9341_WHITE);
tft.println("Preparing to Run ArduOS for the first time...");
delay(1500);
tft.setCursor(1, 148);
tft.setTextColor(ILI9341_BLACK);
tft.println("Preparing to Run ArduOS for the first time...");
tft.setCursor(1, 148);
tft.setTextColor(ILI9341_GREEN);
tft.println("Loading...");
delay(500);
tft.drawRect(10, 177, 300, 37, 0xFFFF);
tft.fillRect(12, 179, 296, 33, ILI9341_BLUE);
tft.setTextColor(0xFFFF);
tft.setTextSize(3);
tft.setTextWrap(false);
for (int i = 0; i < 297; ++i) {
cuh += 1;
tft.drawRect(10, 177, 300, 37, 0xFFFF);
tft.fillRect(12, 179, i, 33, ILI9341_BLUE);
tft.setCursor(126, 184);
if(cuh == random(5, 20)) {
cuh2 = map(i, 0, 296, 0, 100);
cuh = 0;
}
tft.print(String(cuh2) + "%");
delay(10);
tft.fillRect(10, 177, 300, 37, ILI9341_BLACK);
}
tft.startWrite();
tft.setAddrWindow(0, 0, 320, 240);
tft.writePixels((uint16_t*)welcome, 320 * 240, false);
tft.endWrite();
delay(3000);
tft.fillScreen(ILI9341_BLACK);
}
void loop() {
// No loop logic yet
}