The discussion of the Alien series of films and the props used in them is the aim, but if it's got Big Bugs and Big Guns, then they are welcome too!





Post new topic Reply to topic  [ 56 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: security access tuner from alien isolation
PostPosted: Mon Jan 30, 2023 3:03 am 

Service Number: A05/TQ2.0.32141E1
Country: United States
Got the screens a little further along. Re-render logic is settled. Slowly dialing in screen look to as an accuratized look as I can manage. still have to add button game logic, but have to get the bars built first.

Code:
/*Libraries provided by adafruit written by Lady Ada Fried.
 *Please stick to adafruit products as chinese knock offs are very,
 *very, very, problematic.
 * code for bar courtesy of:
 * https://forum.arduino.cc/t/tft-progress-bar-wont-go-back-down/989189
 * some code pulled from isolation motion tracker pulled from:
 * https://www.instructables.com/Arduino-Motion-Tracker-From-Alien-Isolation/?fbclid=IwAR2P0H8tUwBisNGaP4C2vccz-fbBOlxxfdm8EIJJEHgAZnKOtgemeBjAZ3M
 * help found on arduino forums at https://arduino.cc
 *
 *
 */
 // Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#include <LcdProgressBar.h>
#include <LiquidCrystal.h>

// For the Adafruit shield, these are the default.
#define TFT_MISO 8
#define TFT_DC 9
#define TFT_CS 10
#define TFT_MOSI 11
#define TFT_CLK 13


// the colors are in a RGB565 format, so to get it you first need to grab it as a RGB888 and convert
//go here
//https://imagecolorpicker.com/en
//then here
//http://www.barth-dev.de/online/rgb565-color-picker/
// Assign human-readable names to some common 16-bit color values:
#define  BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF
#define DARKGREEN   0x03E0
#define OLIVE   0x7BE0
#define GREENYELLOW   0xAFE5
#define TEAL 0x263F


// button pins
#define BUTTON_PIN_1 18
#define BUTTON_PIN_2 19
// pot pins are pins 14 and 15
Bounce debouncer1 = Bounce();
Bounce debouncer2 = Bounce();
// integer declarations
int rangelow;
int rangehigh;
int g1low = 80;
int g1high = 80;
int center;
int detect = 0;
int render = 0;

//TFT TFTscreen = TFT(cs, dc, rst);
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_MISO);



void setup() {
  pinMode(A0, INPUT);
  tft.begin();
  tft.fillScreen(BLACK);
  tft.setRotation(1); //this sets 0,0 as the top left corner
  txt();
  boot1();
  boot2();
//  tft.setRotation(0);
  tft.fillScreen(BLACK);
  tft.setRotation(1);
// button initialization
  pinMode(BUTTON_PIN_1,INPUT_PULLUP); debouncer1.attach(BUTTON_PIN_1); debouncer1.interval(5);   
  pinMode(BUTTON_PIN_2,INPUT_PULLUP); debouncer2.attach(BUTTON_PIN_2); debouncer2.interval(25);
// sets up random number generator for game1 to game 2 transition
  randomSeed(analogRead(A3));
  center = random(150, 950);
  int myHeight = tft.height();
  int myWidth = tft.width();
     
 
}

void loop() {
  rangelow = center - g1low;
  rangehigh = center + g1high;
// comment out the bottom two lines and replace them with the below line to aid in calibrating your setup
// calibration();
  if (rangelow < analogRead(A0) &&  analogRead(A0) < rangehigh) { game2();}
  else { game1();   } //tft.fillRect(230, 40, 20, 20, BLACK);}
// declarations for buttons
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
  delay(20);
}

void calibration() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  int bar = map(analogRead(A0), 0, 1023, 0, 308);
  tft.fillRect(6, 80, bar, 44, RED);
  tft.fillRect(bar, 80, 308 - bar, 44, BLACK);
  tft.fillRect(0, 20, myWidth, 5, BLACK);
// draws pot number reading
  tft.setCursor(80,40);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(analogRead(A0));
// draws pot 2 number reading
  tft.setCursor(160,40);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(analogRead(A1));
// clears button status
  tft.fillRect(80, 140, 100, 30, BLACK);
   tft.fillRect(80, 180, 100, 30, BLACK);
  // add rendering pause
  delay(100);
  // clears drawings
  tft.fillRect(bar, 20, 20, 5, WHITE);
  tft.fillRect(80, 40, 200, 30, BLACK);
  game1();
//math for range sweetspot logic
  rangelow = center - g1low;
  rangehigh = center + g1high;
  if (rangelow < analogRead(A0) &&  analogRead(A0) < rangehigh) { tft.fillRect(230, 40, 20, 20, OLIVE); }
  else {tft.fillRect(230, 40, 20, 20, BLACK);}
// declarations for buttons
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
// draws button 2 status
  tft.setCursor(160,140);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(value2);
  // draws button 1 status
  tft.setCursor(80,140);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(value1);
  // draws button 2 status
  tft.setCursor(160,180);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(rangelow);
  // draws button 1 status
  tft.setCursor(80,180);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(rangehigh);
// clears text
  }

  void txt() {//Starting :)
  tft.fillScreen(BLACK);
  tft.setCursor(60, 20);
  tft.setTextColor(WHITE);
  tft.setTextSize(5);
  tft.println("B2-LAB");
  tft.setCursor(20, 80);
  tft.setTextColor(GREEN);
  tft.setTextSize(3);
  tft.println("MOTION-TRACKER");
  tft.setCursor(10,130);
  tft.setTextColor(RED);
  tft.setTextSize(2);
  tft.println("^VERTICAL WHEN OPERATING^");
  tft.setCursor(60, 150);
  tft.setTextColor(GREEN);
  tft.setTextSize(2);
  tft.print("Calibrate Sensors");
  tft.setCursor(10, 170);
  tft.setTextSize(3);
  for(int i=0;i<4;i++) { tft.print("."); delay(500); }
}

void boot1() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  byte progress = myWidth/8;
  tft.fillScreen(BLACK);
  tft.setCursor(30, 10);
  tft.setTextColor(GREEN);
  tft.setTextSize(6);
  tft.println("SEEGSON");
  tft.drawRect(myWidth*2/16, myHeight*3/5, myWidth*12/16-5, 50, GREEN);
  for(int i=0;i<40;i++) {
    tft.fillRect(myWidth*2/16, myHeight*3/5, progress, 50, GREEN);
    tft.setTextSize(2);
    tft.setCursor(10, 100);
    tft.print("Progress =  ");
    tft.setTextSize(2);
    tft.setCursor(140, 100);
    tft.println(progress);   
    delay(5);
    tft.fillRect(140, 100, 50, 20, BLACK);
    progress += 5;             
//    delay(5);     
  }
}

void boot2() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  tft.fillScreen(BLACK);
  tft.setCursor(myWidth*3/16, myHeight*9/12);
  tft.setTextColor(WHITE);
  tft.setTextSize(3);
  tft.print("Please wait");
  tft.drawRect(myWidth/2, myHeight*1/5, 5, 20, WHITE);
  delay(200);
  tft.drawRect(myWidth/2, myHeight*1/5, 5, 20, BLACK);
  tft.drawLine(myWidth*7/16, myHeight*3/12, myWidth*9/16, myHeight*1/12, WHITE);
  delay(200);
  tft.drawLine(myWidth*7/16, myHeight*3/12, myWidth*9/16, myHeight*1/12, BLACK);
 
  }
void game2() {
// declare variables for function 
  int myHeight = tft.height();
  int myWidth = tft.width();
  int estcon;
  int senpak;
// sets base text for game 
  tft.setCursor(myWidth*3/16, myHeight*1/12);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("SYSTEM OVERRIDE");
  tft.setCursor(myWidth*4/16-10, myHeight*11/12);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("SECURITY FREQUENCY MATCH");
  tft.setCursor(myWidth*4/16, myHeight*12/12-10);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("V2.34 SYSTEM TEST");


 
// calibration testing
  tft.setCursor(myWidth*4/16, myHeight*10/12-10);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.println(analogRead(A1));
 
 
// the big minigame border
  tft.drawRect(3, myHeight*3/12, myWidth-9, myHeight*6/12, WHITE);
  tft.drawRect(6, myHeight*3/12, myWidth-15, myHeight*6/12, WHITE);
// bar 1 override takes reading from slider pot and draws the bar
  tft.setCursor(20, myHeight*3/12+5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Establishing Connection");
  estcon = map(analogRead(A1), 0, 1023, 10, 295); 
  tft.fillRect(estcon, myHeight*4/12 , 5, 15, WHITE);
// redraws left of the slider 
  tft.fillRect(9, myHeight*4/12, estcon-1, 15, TEAL);
// redraws right of the slider 
  tft.fillRect(estcon+12, myHeight*4/12, myWidth-estcon-30, 15, TEAL);
// these are the static vertical lines on the bar 
  tft.drawRect(9, myHeight*4/12, myWidth-30, 15, WHITE);
  tft.drawRect(myWidth*4/16-10, myHeight*4/12, 4, 15, WHITE); 
  tft.drawRect(myWidth*4/16+10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16+10, myHeight*4/12, 4, 15, WHITE);   
  tft.drawRect(myWidth*6/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*6/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*6/16+10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*7/16, myHeight*4/12, 4, 15, WHITE);   
// bar 2 override takes reading from slider pot and draws the bar
  tft.setCursor(20, myHeight*5/12+5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Sending Packets");
  senpak = map(analogRead(A1), 0, 1023, 10, 295);
  tft.fillRect(senpak, myHeight*6/12 , 5, 15, WHITE);
// redraws left of the slider 
  tft.fillRect(9, myHeight*6/12, senpak-1, 15, TEAL);
// redraws right of the slider 
  tft.fillRect(senpak+12, myHeight*6/12, myWidth-senpak-30, 15, TEAL);
// draws lines
  tft.drawRect(9, myHeight*6/12, myWidth-30, 15, WHITE);
  tft.drawRect(myWidth*3/16-10, myHeight*6/12, 4, 15, WHITE); 
  tft.drawRect(myWidth*3/16+10, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*3/16, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16-10, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16+10, myHeight*6/12, 4, 15, WHITE);   


   
// This delays the redrawing of the entire screen 
  render++;
  delay(10);
  if (render == 2) { tft.fillScreen(TEAL); render++; }
  if (render == 70) {  render = 0;  }
// rerender pieces set after delay
  tft.fillRect(myWidth*4/16, myHeight*10/12-10, 100, 20, TEAL);
 
  }

void game1() {
  int myHeight = tft.height(); int myWidth = tft.width();
// this is a delayed screen rerender   
  int render1;
  render1++;
  delay(10);
  if (render1 == 2) { tft.fillScreen(BLACK); render1++; }
  if (render1 == 70) { render1 = 0; }
  //I ended up having to separate out remaps for each side of the slider bar
 
  int bordw = map(analogRead(A0), 0, 1023, 0, 1023);
  int bordt = map(analogRead(A0), 0, 256, 0, myWidth);
  int bordrh = map(analogRead(A0), 256, 512, 0, myHeight);
  int bordb = map(analogRead(A0), 512, 768, myWidth, 0);
  int bordlh = map(analogRead(A0), 768, 1023, myHeight, 0);
 
//below greyed out was used to figure out logic of slider bar for game 1
/*
  // top border, right, bottom, left border bar
  if (1 < bordw < 256){ tft.fillRect(bordt, 0, 20, 5, WHITE); delay(100); tft.fillRect(0, 0, myWidth, 5, BLACK); }
  if (257 < bordw < 512){ tft.fillRect(myWidth -5, bordrh, 5, 20, WHITE); delay(100); tft.fillRect(myWidth -5, 0, 5, myHeight, BLACK); }
  if (512 < bordw < 768){ tft.fillRect(bordb, (myHeight - 5), 20, 5, WHITE); delay(100); tft.fillRect(0, (myHeight - 5), myWidth, 5, BLACK); }
  if (768 < bordw < 1023){ tft.fillRect(0, bordlh, 5, 20, WHITE); delay(100); tft.fillRect(0, 0, 5, myHeight, BLACK); }
  */
// after figuring out logic I tested to see if just simplifying and condensing the statements without if cases would work (it worked.)
  tft.fillRect(bordt, 0, 20, 5, WHITE);         
  tft.fillRect(myWidth -5, bordrh, 5, 20, WHITE);   
  tft.fillRect(bordb, (myHeight - 5), 20, 5, WHITE);
  tft.fillRect(0, bordlh, 5, 20, WHITE);
  delay(10);
  tft.fillRect(0, 0, 5, myHeight, BLACK);
  tft.fillRect(0, 0, myWidth, 5, BLACK);
  tft.fillRect(myWidth -5, 0, 5, myHeight, BLACK);
  tft.fillRect(0, (myHeight - 5), myWidth, 5, BLACK);
// center box
// yellow border
  tft.drawRect(myWidth*2/16 -8, myHeight*4/12, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -7, myHeight*4/12-1, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -6, myHeight*4/12-2, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -5, myHeight*4/12-3, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -4, myHeight*4/12-4, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -5, myHeight*4/12-5, myWidth*13/16+12, myHeight*4/12, YELLOW); 
// text segments 
  tft.setCursor(myWidth*2/16, myHeight*5/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("INCORRECT CODE");
  tft.setCursor(myWidth*2/16, myHeight*7/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("SYSTEM DETECTIONS");
  tft.setCursor(myWidth*13/16, myHeight*7/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print(detect);
  tft.setCursor(myWidth*13/16+12, myHeight*7/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("/3");
}

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject: Re: security access tuner from alien isolation
PostPosted: Mon Jan 30, 2023 3:27 am 

Service Number: A05/TQ2.0.32141E1
Country: United States
And some progress pictures.

IMG_5511.JPG
IMG_5511.JPG [ 1.02 MiB | Viewed 1318 times ]

IMG_5508.JPG
IMG_5508.JPG [ 1.8 MiB | Viewed 1318 times ]

IMG_5504.JPG
IMG_5504.JPG [ 1.82 MiB | Viewed 1318 times ]

IMG_5503.JPG
IMG_5503.JPG [ 1.92 MiB | Viewed 1318 times ]


_________________
The impossible takes a while longer and goes over budget too...
Top
 Profile  
Reply with quote  
 Post subject: Re: Re:
PostPosted: Thu Feb 02, 2023 10:55 pm 
User avatar

Location: Wellywood.
Service Number: A10/TQ0.0.82146E1
Country: New Zealand
septic wrote:
Space Jockey wrote:
[
I wouldn't want to convert a real radio. if you own one, would you be willing to please provide a couple of dimensions so I can get some cad files drawn up for us all?

Yup, will do in the next day or two.


Photo's taken, but I feel it's not fair / distracting from Joker's project to post everything here. Happy to supply pics / measurements to anyone that wants em (PM me).
Here's one for now though -
Attachment:
325256677_892538802174828_230485119831839975_n.jpg
325256677_892538802174828_230485119831839975_n.jpg [ 294.29 KiB | Viewed 1297 times ]


Dimensions are 148mm high x 76mm across x 35mm deep

_________________
Cpl Aron "septic" Williams
A10/TQ0.0.82146E1


Top
 Profile  
Reply with quote  
 Post subject: Re: Re:
PostPosted: Fri Feb 03, 2023 5:18 am 

Service Number: A05/TQ2.0.32141E1
Country: United States
septic wrote:
septic wrote:
Space Jockey wrote:
[
I wouldn't want to convert a real radio. if you own one, would you be willing to please provide a couple of dimensions so I can get some cad files drawn up for us all?

Yup, will do in the next day or two.


Photo's taken, but I feel it's not fair / distracting from Joker's project to post everything here. Happy to supply pics / measurements to anyone that wants em (PM me).
Here's one for now though -
Attachment:
325256677_892538802174828_230485119831839975_n.jpg


Dimensions are 148mm high x 76mm across x 35mm deep


You are fine. There is really only one 3d file out there and it is only somewhat accurate.

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject: Re: security access tuner from alien isolation
PostPosted: Sat Feb 04, 2023 10:16 pm 

Service Number: A05/TQ2.0.32141E1
Country: United States
progress pictures

tuner4.JPG
tuner4.JPG [ 1.81 MiB | Viewed 1278 times ]

tuner3.JPG
tuner3.JPG [ 1.82 MiB | Viewed 1278 times ]

tuner2.JPG
tuner2.JPG [ 1.48 MiB | Viewed 1278 times ]

tuner1.JPG
tuner1.JPG [ 1.2 MiB | Viewed 1278 times ]

IMG_5515.JPG
IMG_5515.JPG [ 1.77 MiB | Viewed 1278 times ]


_________________
The impossible takes a while longer and goes over budget too...
Top
 Profile  
Reply with quote  
 Post subject: code update
PostPosted: Mon Feb 06, 2023 3:49 am 

Service Number: A05/TQ2.0.32141E1
Country: United States
OK, got the bars all built. Next up is logic for the bars which I have figured out on paper just have to test and implement in code

Code:
/*Libraries provided by adafruit written by Lady Ada Fried.
 *Please stick to adafruit products as chinese knock offs are very,
 *very, very, very, very, very problematic.
 * code for bar courtesy of:
 * https://forum.arduino.cc/t/tft-progress-bar-wont-go-back-down/989189
 * some code pulled from isolation motion tracker pulled from:
 * https://www.instructables.com/Arduino-Motion-Tracker-From-Alien-Isolation/?fbclid=IwAR2P0H8tUwBisNGaP4C2vccz-fbBOlxxfdm8EIJJEHgAZnKOtgemeBjAZ3M
 * help found on arduino forums at https://arduino.cc
 */
 // Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#include <LcdProgressBar.h>
#include <LiquidCrystal.h>

// For the Adafruit shield, these are the default.
#define TFT_MISO 8
#define TFT_DC 9
#define TFT_CS 10
#define TFT_MOSI 11
#define TFT_CLK 13


// the colors are in a RGB565 format, so to get it you first need to grab it as a RGB888 and convert
//go here
//https://imagecolorpicker.com/en
//then here
//http://www.barth-dev.de/online/rgb565-color-picker/
// Assign human-readable names to some common 16-bit color values:
#define  BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF
#define DARKGREEN   0x03E0
#define OLIVE   0x7BE0
#define GREENYELLOW   0xAFE5
#define TEAL 0x263F


// button pins
#define BUTTON_PIN_1 18
#define BUTTON_PIN_2 19
// pot pins are pins 14 and 15
Bounce debouncer1 = Bounce();
Bounce debouncer2 = Bounce();
// integer declarations
int rangelow;
int rangehigh;
int g1low = 80;
int g1high = 80;
int center;
int detect = 0;
int render = 0;

//TFT TFTscreen = TFT(cs, dc, rst);
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_MISO);



void setup() {
  pinMode(A0, INPUT);
  tft.begin();
  tft.fillScreen(BLACK);
  tft.setRotation(1); //this sets 0,0 as the top left corner
  txt();
  boot1();
  boot2();
//  tft.setRotation(0);
  tft.fillScreen(BLACK);
  tft.setRotation(1);
// button initialization
  pinMode(BUTTON_PIN_1,INPUT_PULLUP); debouncer1.attach(BUTTON_PIN_1); debouncer1.interval(5);   
  pinMode(BUTTON_PIN_2,INPUT_PULLUP); debouncer2.attach(BUTTON_PIN_2); debouncer2.interval(25);
// sets up random number generator for game1 to game 2 transition
  randomSeed(analogRead(A3));
  center = random(150, 950);
  int myHeight = tft.height();
  int myWidth = tft.width();
     
 
}

void loop() {
  rangelow = center - g1low;
  rangehigh = center + g1high;
// comment out the bottom two lines and replace them with the below line to aid in calibrating your setup
// calibration();
  if (rangelow < analogRead(A0) &&  analogRead(A0) < rangehigh) { game2();}
  else { game1();   } //tft.fillRect(230, 40, 20, 20, BLACK);}
// declarations for buttons
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
  delay(20);
}

void calibration() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  int bar = map(analogRead(A0), 0, 1023, 0, 308);
  tft.fillRect(6, 80, bar, 44, RED);
  tft.fillRect(bar, 80, 308 - bar, 44, BLACK);
  tft.fillRect(0, 20, myWidth, 5, BLACK);
// draws pot number reading
  tft.setCursor(80,40);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(analogRead(A0));
// draws pot 2 number reading
  tft.setCursor(160,40);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(analogRead(A1));
// clears button status
  tft.fillRect(80, 140, 100, 30, BLACK);
   tft.fillRect(80, 180, 100, 30, BLACK);
  // add rendering pause
  delay(100);
  // clears drawings
  tft.fillRect(bar, 20, 20, 5, WHITE);
  tft.fillRect(80, 40, 200, 30, BLACK);
  game1();
//math for range sweetspot logic
  rangelow = center - g1low;
  rangehigh = center + g1high;
  if (rangelow < analogRead(A0) &&  analogRead(A0) < rangehigh) { tft.fillRect(230, 40, 20, 20, OLIVE); }
  else {tft.fillRect(230, 40, 20, 20, BLACK);}
// declarations for buttons
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
// draws button 2 status
  tft.setCursor(160,140);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(value2);
  // draws button 1 status
  tft.setCursor(80,140);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(value1);
  // draws pot 2 status
  tft.setCursor(160,180);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(rangelow);
  // draws pot 1 status
  tft.setCursor(80,180);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(rangehigh);
// clears text
  }

  void txt() {//Starting :)
  tft.fillScreen(BLACK);
  tft.setCursor(60, 20);
  tft.setTextColor(WHITE);
  tft.setTextSize(5);
  tft.println("B2-LAB");
  tft.setCursor(20, 80);
  tft.setTextColor(GREEN);
  tft.setTextSize(3);
  tft.println("MOTION-TRACKER");
  tft.setCursor(10,130);
  tft.setTextColor(RED);
  tft.setTextSize(2);
  tft.println("^VERTICAL WHEN OPERATING^");
  tft.setCursor(60, 150);
  tft.setTextColor(GREEN);
  tft.setTextSize(2);
  tft.print("Calibrate Sensors");
  tft.setCursor(10, 170);
  tft.setTextSize(3);
  for(int i=0;i<4;i++) { tft.print("."); delay(500); }
}

void boot1() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  byte progress = myWidth/8;
  tft.fillScreen(BLACK);
  tft.setCursor(30, 10);
  tft.setTextColor(GREEN);
  tft.setTextSize(6);
  tft.println("SEEGSON");
  tft.drawRect(myWidth*2/16, myHeight*3/5, myWidth*12/16-5, 50, GREEN);
  for(int i=0;i<40;i++) {
    tft.fillRect(myWidth*2/16, myHeight*3/5, progress, 50, GREEN);
    tft.setTextSize(2);
    tft.setCursor(10, 100);
    tft.print("Progress =  ");
    tft.setTextSize(2);
    tft.setCursor(140, 100);
    tft.println(progress);   
    delay(5);
    tft.fillRect(140, 100, 50, 20, BLACK);
    progress += 5;             
//    delay(5);     
  }
}

void boot2() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  tft.fillScreen(BLACK);
  tft.setCursor(myWidth*3/16, myHeight*9/12);
  tft.setTextColor(WHITE);
  tft.setTextSize(3);
  tft.print("Please wait");
  tft.drawRect(myWidth/2, myHeight*1/5, 5, 20, WHITE);
  delay(200);
  tft.drawRect(myWidth/2, myHeight*1/5, 5, 20, BLACK);
  tft.drawLine(myWidth*7/16, myHeight*3/12, myWidth*9/16, myHeight*1/12, WHITE);
  delay(200);
  tft.drawLine(myWidth*7/16, myHeight*3/12, myWidth*9/16, myHeight*1/12, BLACK);
 
  }
void game2() {
// declare variables for function 
  int myHeight = tft.height();
  int myWidth = tft.width();
  int estcon;
  int senpak;
  int ovrpak;
// sets base text for game 
  tft.setCursor(myWidth*3/16, myHeight*1/12);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("SYSTEM OVERRIDE");
  tft.setCursor(myWidth*4/16-10, myHeight*11/12);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("SECURITY FREQUENCY MATCH");
  tft.setCursor(myWidth*4/16, myHeight*12/12-10);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("V2.34 SYSTEM TEST");


 
// calibration testing
  tft.setCursor(myWidth*4/16, myHeight*10/12-10);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.println(analogRead(A1));
// declarations for buttons
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
// draws button 2 status
  tft.setCursor(myWidth*6/16, myHeight*10/12-10);
  tft.setTextColor(RED);
  tft.setTextSize(1);
  tft.println(value2);
  // draws button 1 status
  tft.setCursor(myWidth*8/16, myHeight*10/12-10);
  tft.setTextColor(OLIVE);
  tft.setTextSize(1);
  tft.println(value1);

 
 
// the big minigame border
  tft.drawRect(3, myHeight*3/12, myWidth-9, myHeight*6/12, WHITE);
  tft.drawRect(6, myHeight*3/12, myWidth-15, myHeight*6/12, WHITE);
// bar 1 override takes reading from slider pot and draws the bar
  tft.setCursor(20, myHeight*3/12+5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Establishing Connection");
  estcon = map(analogRead(A1), 0, 1023, 10, 295); 
  tft.fillRect(estcon, myHeight*4/12 , 5, 15, WHITE);
// redraws left of the slider 
  tft.fillRect(9, myHeight*4/12, estcon-1, 15, TEAL);
// redraws right of the slider 
  tft.fillRect(estcon+12, myHeight*4/12, myWidth-estcon-30, 15, TEAL);
// these are the static vertical lines on the bar 
  tft.drawRect(9, myHeight*4/12, myWidth-30, 15, WHITE);
  tft.drawRect(myWidth*4/16-10, myHeight*4/12, 4, 15, WHITE); 
  tft.drawRect(myWidth*4/16+10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16+10, myHeight*4/12, 4, 15, WHITE);   
  tft.drawRect(myWidth*6/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*6/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*6/16+10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*7/16, myHeight*4/12, 4, 15, WHITE);   
// bar 2 override takes reading from slider pot and draws the bar
  tft.setCursor(20, myHeight*5/12+5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Sending Packets");
  senpak = map(analogRead(A1), 0, 1023, 10, 295);
  tft.fillRect(senpak, myHeight*6/12 , 5, 15, WHITE);
// redraws left of the slider 
  tft.fillRect(9, myHeight*6/12, senpak-1, 15, TEAL);
// redraws right of the slider 
  tft.fillRect(senpak+12, myHeight*6/12, myWidth-senpak-30, 15, TEAL);
// draws lines
  tft.drawRect(9, myHeight*6/12, myWidth-30, 15, WHITE);
  tft.drawRect(myWidth*3/16-10, myHeight*6/12, 4, 15, WHITE); 
  tft.drawRect(myWidth*3/16+10, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*3/16, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16-10, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16+10, myHeight*6/12, 4, 15, WHITE);   
//bar 3
  tft.setCursor(20, myHeight*7/12+5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Overriding Protocol");
  ovrpak = map(analogRead(A1), 0, 1023, 10, 295);
  tft.fillRect(ovrpak, myHeight*8/12 , 5, 15, WHITE);
// redraws left of the slider 
  tft.fillRect(9, myHeight*8/12, ovrpak-1, 15, TEAL);
// redraws right of the slider 
  tft.fillRect(ovrpak+12, myHeight*8/12, myWidth-ovrpak-30, 15, TEAL);
// draws lines
  tft.drawRect(9, myHeight*8/12, myWidth-30, 15, WHITE);
  tft.drawRect(myWidth*3/16-10, myHeight*8/12, 4, 15, WHITE); 
  tft.drawRect(myWidth*3/16+10, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*3/16, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16-10, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16+10, myHeight*8/12, 4, 15, WHITE); 
   
// This delays the redrawing of the entire screen 
  render++;
  delay(10);
  if (render == 2) { tft.fillScreen(TEAL); render++; }
  if (render == 70) {  render = 0;  }
// rerender pieces set after delay
  tft.fillRect(myWidth*4/16, myHeight*10/12-10, 100, 20, TEAL);
}

void game1() {
  int myHeight = tft.height(); int myWidth = tft.width();
// this is a delayed screen rerender   
  int render1;
  render1++;
  delay(10);
  if (render1 == 2) { tft.fillScreen(BLACK); render1++; }
  if (render1 == 40) { render1 = 0; }
  //I ended up having to separate out remaps for each side of the slider bar
 
  int bordw = map(analogRead(A0), 0, 1023, 0, 1023);
  int bordt = map(analogRead(A0), 0, 256, 0, myWidth);
  int bordrh = map(analogRead(A0), 256, 512, 0, myHeight);
  int bordb = map(analogRead(A0), 512, 768, myWidth, 0);
  int bordlh = map(analogRead(A0), 768, 1023, myHeight, 0);
 
//below greyed out was used to figure out logic of slider bar for game 1
/*
  // top border, right, bottom, left border bar
  if (1 < bordw < 256){ tft.fillRect(bordt, 0, 20, 5, WHITE); delay(100); tft.fillRect(0, 0, myWidth, 5, BLACK); }
  if (257 < bordw < 512){ tft.fillRect(myWidth -5, bordrh, 5, 20, WHITE); delay(100); tft.fillRect(myWidth -5, 0, 5, myHeight, BLACK); }
  if (512 < bordw < 768){ tft.fillRect(bordb, (myHeight - 5), 20, 5, WHITE); delay(100); tft.fillRect(0, (myHeight - 5), myWidth, 5, BLACK); }
  if (768 < bordw < 1023){ tft.fillRect(0, bordlh, 5, 20, WHITE); delay(100); tft.fillRect(0, 0, 5, myHeight, BLACK); }
  */
// after figuring out logic I tested to see if just simplifying and condensing the statements without if cases would work (it worked.)
  tft.fillRect(bordt, 0, 20, 5, WHITE);         
  tft.fillRect(myWidth -5, bordrh, 5, 20, WHITE);   
  tft.fillRect(bordb, (myHeight - 5), 20, 5, WHITE);
  tft.fillRect(0, bordlh, 5, 20, WHITE);
  delay(10);
  tft.fillRect(0, 0, 5, myHeight, BLACK);
  tft.fillRect(0, 0, myWidth, 5, BLACK);
  tft.fillRect(myWidth -5, 0, 5, myHeight, BLACK);
  tft.fillRect(0, (myHeight - 5), myWidth, 5, BLACK);
// center box
// yellow border
  tft.drawRect(myWidth*2/16 -8, myHeight*4/12, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -7, myHeight*4/12-1, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -6, myHeight*4/12-2, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -5, myHeight*4/12-3, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -4, myHeight*4/12-4, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -3, myHeight*4/12-5, myWidth*13/16+12, myHeight*4/12, YELLOW); 
// text segments 
  tft.setCursor(myWidth*2/16, myHeight*5/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("INCORRECT CODE");
  tft.setCursor(myWidth*2/16, myHeight*7/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("SYSTEM DETECTIONS");
  tft.setCursor(myWidth*13/16, myHeight*7/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print(detect);
  tft.setCursor(myWidth*13/16+12, myHeight*7/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("/3");
}

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Feb 08, 2023 1:17 am 
User avatar

Location: Wellywood.
Service Number: A10/TQ0.0.82146E1
Country: New Zealand
Hey, not meaning to be discouraging as I love what your doing, but is there a reason you don't attach these code dumps as a text or zipped file to your posts?

Walls of text clutter up build threads, and can make them quite hard to read. Just my $0.02.

_________________
Cpl Aron "septic" Williams
A10/TQ0.0.82146E1


Top
 Profile  
Reply with quote  
 Post subject: Re:
PostPosted: Wed Feb 08, 2023 5:36 am 

Service Number: A05/TQ2.0.32141E1
Country: United States
septic wrote:
Hey, not meaning to be discouraging as I love what your doing, but is there a reason you don't attach these code dumps as a text or zipped file to your posts?

Walls of text clutter up build threads, and can make them quite hard to read. Just my $0.02.


One this post was an error. I clicked the wrong button.

Two I just do it with the code hashtags which the forum supports.

However, forum software does have controls and plugins that controls how code displays and that may need to be tweaked.

A point to which you are pointing too as most software forums have code as a sub scrollable section in post to make coding discussions easier.

We need others to weigh in on if the code tag needs to be tweaked so it does not make posts so gosh darned long.

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject: Re: Re:
PostPosted: Wed Feb 08, 2023 2:13 pm 
THAT guy
User avatar

Location: Virginia
Service Number: A03/TQ2.0.02146E1
Country: United States
knoxvilles_joker wrote:

One this post was an error. I clicked the wrong button.


Where should this post have been posted? I will move it to the correct thread


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Feb 08, 2023 3:07 pm 

Service Number: A05/TQ2.0.32141E1
Country: United States
The access tuner thread.

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject: Re: security access tuner from alien isolation
PostPosted: Sun Feb 12, 2023 2:40 am 

Service Number: A05/TQ2.0.32141E1
Country: United States
OK slow progress. I got the bars split out into separate functions to make the if statement encoding easier. I am starting in on programming the logic for the bars. I had switched the setup over to an arduino micro from a trinket pro to make code update pushes less painful.

Code:
/*Libraries provided by adafruit written by Lady Ada Fried.
 *Please stick to adafruit products as chinese knock offs are very,
 *very, very, very, very, very problematic.
 * code for bar courtesy of:
 * https://forum.arduino.cc/t/tft-progress-bar-wont-go-back-down/989189
 * some code pulled from isolation motion tracker pulled from:
 * https://www.instructables.com/Arduino-Motion-Tracker-From-Alien-Isolation/?fbclid=IwAR2P0H8tUwBisNGaP4C2vccz-fbBOlxxfdm8EIJJEHgAZnKOtgemeBjAZ3M
 * help found on arduino forums at https://arduino.cc
 */
 // Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#include <LcdProgressBar.h>
#include <LiquidCrystal.h>

// For the Adafruit shield, these are the default.
#define TFT_MISO 8
#define TFT_DC 9
#define TFT_CS 10
#define TFT_MOSI 11
#define TFT_CLK 12


// the colors are in a RGB565 format, so to get it you first need to grab it as a RGB888 and convert
//go here
//https://imagecolorpicker.com/en
//then here
//http://www.barth-dev.de/online/rgb565-color-picker/
// Assign human-readable names to some common 16-bit color values:
#define  BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF
#define DARKGREEN   0x03E0
#define OLIVE   0x7BE0
#define GREENYELLOW   0xAFE5
#define TEAL 0x263F
// button pins
//22 is a4, 23 is a5 on micro.
#define BUTTON_PIN_1 23
#define BUTTON_PIN_2 22
// pot pins are pins 14(a0) and 15(a1)
Bounce debouncer1 = Bounce();
Bounce debouncer2 = Bounce();
//global integer declarations
// arguments exist against global variables, however, they are nice if you use integers across functions
int rangelow;
int rangehigh;
int g1low = 80;
int g1high = 80;
int center;
int detect = 0;
int render = 0;
int b1 = 0;
int b2 = 0;
//invokation for the adafruit TFT
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_MISO);

void setup() {
  pinMode(A0, INPUT);
  tft.begin();
  tft.fillScreen(BLACK);
  tft.setRotation(1); //this sets 0,0 as the top left corner
//  txt(); //used to import screen settings from motion tracker code
  boot1();
  boot2();
  tft.fillScreen(BLACK);
  tft.setRotation(1);
// button initialization
  pinMode(BUTTON_PIN_1,INPUT_PULLUP); debouncer1.attach(BUTTON_PIN_1); debouncer1.interval(5);   
  pinMode(BUTTON_PIN_2,INPUT_PULLUP); debouncer2.attach(BUTTON_PIN_2); debouncer2.interval(25);
// sets up random number generator for game1 to game 2 transition
  randomSeed(analogRead(A3));
  center = random(150, 950);
  int myHeight = tft.height();
  int myWidth = tft.width();
}

void loop() {
  rangelow = center - g1low;
  rangehigh = center + g1high;
// comment out the bottom two lines and replace them with the below line to aid in calibrating your setup
// calibration();
  if (rangelow < analogRead(A0) &&  analogRead(A0) < rangehigh) { game2();}
  else { game1();   } //tft.fillRect(230, 40, 20, 20, BLACK);}
// declarations for buttons
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
  delay(20);
}

void calibration() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  int bar = map(analogRead(A0), 0, 1023, 0, 308);
  tft.fillRect(6, 80, bar, 44, RED);
  tft.fillRect(bar, 80, 308 - bar, 44, BLACK);
  tft.fillRect(0, 20, myWidth, 5, BLACK);
// draws pot number reading
  tft.setCursor(80,40);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(analogRead(A0));
// draws pot 2 number reading
  tft.setCursor(160,40);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(analogRead(A1));
// clears button status
  tft.fillRect(80, 140, 100, 30, BLACK);
   tft.fillRect(80, 180, 100, 30, BLACK);
  // add rendering pause
  delay(100);
  // clears drawings
  tft.fillRect(bar, 20, 20, 5, WHITE);
  tft.fillRect(80, 40, 200, 30, BLACK);
  game1();
//math for range sweetspot logic
  rangelow = center - g1low;
  rangehigh = center + g1high;
  if (rangelow < analogRead(A0) &&  analogRead(A0) < rangehigh) { tft.fillRect(230, 40, 20, 20, OLIVE); }
  else {tft.fillRect(230, 40, 20, 20, BLACK);}
// declarations for buttons
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
// draws button 2 status
  tft.setCursor(160,140);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(value2);
  // draws button 1 status
  tft.setCursor(80,140);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(value1);
  // draws pot 2 status
  tft.setCursor(160,180);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(rangelow);
  // draws pot 1 status
  tft.setCursor(80,180);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(rangehigh);
// clears text
  }

  void txt() {//Starting :)
  tft.fillScreen(BLACK);
  tft.setCursor(60, 20);
  tft.setTextColor(WHITE);
  tft.setTextSize(5);
  tft.println("B2-LAB");
  tft.setCursor(20, 80);
  tft.setTextColor(GREEN);
  tft.setTextSize(3);
  tft.println("MOTION-TRACKER");
  tft.setCursor(10,130);
  tft.setTextColor(RED);
  tft.setTextSize(2);
  tft.println("^VERTICAL WHEN OPERATING^");
  tft.setCursor(60, 150);
  tft.setTextColor(GREEN);
  tft.setTextSize(2);
  tft.print("Calibrate Sensors");
  tft.setCursor(10, 170);
  tft.setTextSize(3);
  for(int i=0;i<4;i++) { tft.print("."); delay(500); }
}

void boot1() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  byte progress = myWidth/8;
  int progress1;
  tft.fillScreen(BLACK);
  tft.setCursor(30, 10);
  tft.setTextColor(GREEN);
  tft.setTextSize(6);
  tft.println("SEEGSON");
  tft.drawRect(myWidth*2/16, myHeight*3/5, myWidth*12/16-5, 50, GREEN);
  for(int i=0;i<40;i++) {
    tft.fillRect(myWidth*2/16, myHeight*3/5, progress, 50, GREEN);
    tft.setTextSize(2);
    tft.setCursor(10, 100);
    tft.print("Progress =  ");
    tft.setTextSize(2);
    tft.setCursor(140, 100);
    progress1 = progress*17/40;
    tft.println(progress1);   
    delay(5);
    tft.fillRect(140, 100, 50, 20, BLACK);
    progress += 5;             
//    delay(5);     
  }
}

void boot2() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  tft.fillScreen(BLACK);
  tft.setCursor(myWidth*3/16, myHeight*9/12);
  tft.setTextColor(WHITE);
  tft.setTextSize(3);
  tft.print("Please wait");
  tft.drawRect(myWidth/2, myHeight*1/5, 5, 20, WHITE);
  delay(200);
  tft.drawRect(myWidth/2, myHeight*1/5, 5, 20, BLACK);
  tft.drawLine(myWidth*7/16, myHeight*3/12, myWidth*9/16, myHeight*1/12, WHITE);
  delay(200);
  tft.drawLine(myWidth*7/16, myHeight*3/12, myWidth*9/16, myHeight*1/12, BLACK);
 
  }

 
void game2() {
// declare variables for function 
  int myHeight = tft.height();
  int myWidth = tft.width();
  int estcon;
  int senpak;
  int ovrpak;
// sets base text for game 
  tft.setCursor(myWidth*3/16, myHeight*1/12);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("SYSTEM OVERRIDE");
  tft.setCursor(myWidth*4/16-10, myHeight*11/12);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("SECURITY FREQUENCY MATCH");
  tft.setCursor(myWidth*4/16, myHeight*12/12-10);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("V2.34 SYSTEM TEST");
  calibrate2();   
// the big minigame border
  tft.drawRect(3, myHeight*3/12, myWidth-9, myHeight*6/12, WHITE);
  tft.drawRect(6, myHeight*3/12, myWidth-15, myHeight*6/12, WHITE);
//  bar1();
  bar2(); 
  bar3();
 
 
// this rerenders based on button presses
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
  if (value2 == 0) { b2++; }
  if (value2 == 1 && analogRead(A1) > 440) { bar1(); }
  if (value2 == 1 && analogRead(A1) < 220) { bar1(); }
 
  if (value1 == 0) { b1++; }
  if (b1 == 5) { tft.fillScreen(TEAL); b1++; }
  if (b1 == 7) { b1 = 0; } 
// This delays the redrawing of the entire screen 
  render++; delay(10);
  if (render == 2) { tft.fillScreen(TEAL); render++; }
  if (render == 70) {  render = 0;  }
// rerender pieces set after delay

}

void game1() {
  int myHeight = tft.height(); int myWidth = tft.width();
// this is a delayed screen rerender   
  int render1;
  render1++;
  delay(10);
  if (render1 == 2) { tft.fillScreen(BLACK); render1++; }
  if (render1 == 40) { render1 = 0; }
  //I ended up having to separate out remaps for each side of the slider bar
 
  int bordw = map(analogRead(A0), 0, 1023, 0, 1023);
  int bordt = map(analogRead(A0), 0, 256, 0, myWidth);
  int bordrh = map(analogRead(A0), 256, 512, 0, myHeight);
  int bordb = map(analogRead(A0), 512, 768, myWidth, 0);
  int bordlh = map(analogRead(A0), 768, 1023, myHeight, 0);
 
//below greyed out was used to figure out logic of slider bar for game 1
/*
  // top border, right, bottom, left border bar
  if (1 < bordw < 256){ tft.fillRect(bordt, 0, 20, 5, WHITE); delay(100); tft.fillRect(0, 0, myWidth, 5, BLACK); }
  if (257 < bordw < 512){ tft.fillRect(myWidth -5, bordrh, 5, 20, WHITE); delay(100); tft.fillRect(myWidth -5, 0, 5, myHeight, BLACK); }
  if (512 < bordw < 768){ tft.fillRect(bordb, (myHeight - 5), 20, 5, WHITE); delay(100); tft.fillRect(0, (myHeight - 5), myWidth, 5, BLACK); }
  if (768 < bordw < 1023){ tft.fillRect(0, bordlh, 5, 20, WHITE); delay(100); tft.fillRect(0, 0, 5, myHeight, BLACK); }
  */
// after figuring out logic I tested to see if just simplifying and condensing the statements without if cases would work (it worked.)
  tft.fillRect(bordt, 0, 20, 5, WHITE);         
  tft.fillRect(myWidth -5, bordrh, 5, 20, WHITE);   
  tft.fillRect(bordb, (myHeight - 5), 20, 5, WHITE);
  tft.fillRect(0, bordlh, 5, 20, WHITE);
  delay(10);
  tft.fillRect(0, 0, 5, myHeight, BLACK);
  tft.fillRect(0, 0, myWidth, 5, BLACK);
  tft.fillRect(myWidth -5, 0, 5, myHeight, BLACK);
  tft.fillRect(0, (myHeight - 5), myWidth, 5, BLACK);
// center box
// yellow border
  tft.drawRect(myWidth*2/16 -8, myHeight*4/12, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -7, myHeight*4/12-1, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -6, myHeight*4/12-2, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -5, myHeight*4/12-3, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -4, myHeight*4/12-4, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -3, myHeight*4/12-5, myWidth*13/16+12, myHeight*4/12, YELLOW); 
// text segments 
  tft.setCursor(myWidth*2/16, myHeight*5/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("INCORRECT CODE");
  tft.setCursor(myWidth*2/16, myHeight*7/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("SYSTEM DETECTIONS");
  tft.setCursor(myWidth*13/16, myHeight*7/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print(detect);
  tft.setCursor(myWidth*13/16+12, myHeight*7/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("/3");
}

void bar1(){
  int myHeight = tft.height(); int myWidth = tft.width();
  int estcon;
  // bar 1 override takes reading from slider pot and draws the bar
  tft.setCursor(20, myHeight*3/12+5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Establishing Connection");
  estcon = map(analogRead(A1), 0, 1023, 10, 295); 
  tft.fillRect(estcon, myHeight*4/12 , 5, 15, WHITE);
// redraws left of the slider 
  tft.fillRect(9, myHeight*4/12, estcon-1, 15, TEAL);
// redraws right of the slider 
  tft.fillRect(estcon+12, myHeight*4/12, myWidth-estcon-30, 15, TEAL);
// these are the static vertical lines on the bar 
  tft.drawRect(9, myHeight*4/12, myWidth-30, 15, WHITE);
  tft.drawRect(myWidth*4/16-10, myHeight*4/12, 4, 15, WHITE); 
  tft.drawRect(myWidth*4/16+10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16+10, myHeight*4/12, 4, 15, WHITE);   
  tft.drawRect(myWidth*6/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*6/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*6/16+10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*7/16, myHeight*4/12, 4, 15, WHITE);   
}
void bar2() {
  int myHeight = tft.height(); int myWidth = tft.width();
  int senpak;
  // bar 2 override takes reading from slider pot and draws the bar
  tft.setCursor(20, myHeight*5/12+5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Sending Packets");
  senpak = map(analogRead(A1), 0, 1023, 10, 295);
  tft.fillRect(senpak, myHeight*6/12 , 5, 15, WHITE);
// redraws left of the slider 
  tft.fillRect(9, myHeight*6/12, senpak-1, 15, TEAL);
// redraws right of the slider 
  tft.fillRect(senpak+12, myHeight*6/12, myWidth-senpak-30, 15, TEAL);
// draws lines
  tft.drawRect(9, myHeight*6/12, myWidth-30, 15, WHITE);
  tft.drawRect(myWidth*3/16-10, myHeight*6/12, 4, 15, WHITE); 
  tft.drawRect(myWidth*3/16+10, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*3/16, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16-10, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16+10, myHeight*6/12, 4, 15, WHITE); 
}
void bar3(){
  int myHeight = tft.height(); int myWidth = tft.width();
  int ovrpak;
  //bar 3
  tft.setCursor(20, myHeight*7/12+5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Overriding Protocol");
  ovrpak = map(analogRead(A1), 0, 1023, 10, 295);
  tft.fillRect(ovrpak, myHeight*8/12 , 5, 15, WHITE);
// redraws left of the slider 
  tft.fillRect(9, myHeight*8/12, ovrpak-1, 15, TEAL);
// redraws right of the slider 
  tft.fillRect(ovrpak+12, myHeight*8/12, myWidth-ovrpak-30, 15, TEAL);
// draws lines
  tft.drawRect(9, myHeight*8/12, myWidth-30, 15, WHITE);
  tft.drawRect(myWidth*3/16-10, myHeight*8/12, 4, 15, WHITE); 
  tft.drawRect(myWidth*3/16+10, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*3/16, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16-10, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16+10, myHeight*8/12, 4, 15, WHITE); 
   
}
void calibrate2(){
  int myHeight = tft.height(); int myWidth = tft.width();
  // calibration testing
  tft.setCursor(myWidth*4/16, myHeight*10/12-10);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.println(analogRead(A1));
// declarations for buttons
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
// draws button 2 status
  tft.setCursor(myWidth*6/16, myHeight*10/12-10);
  tft.setTextColor(RED);
  tft.setTextSize(1);
  tft.println(value2);
  // draws button 1 status
  tft.setCursor(myWidth*8/16, myHeight*10/12-10);
  tft.setTextColor(OLIVE);
  tft.setTextSize(1);
  tft.println(value1);
  delay(10);
  tft.fillRect(myWidth*4/16, myHeight*10/12-10, 100, 20, TEAL);
// end calibration testing section
}


_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject: Re: security access tuner from alien isolation
PostPosted: Sun Feb 12, 2023 6:00 am 

Service Number: A05/TQ2.0.32141E1
Country: United States
OK was getting some of the logic built, just need to test:

Code:
/*Libraries provided by adafruit written by Lady Ada Fried.
 *Please stick to adafruit products as chinese knock offs are very,
 *very, very, very, very, very problematic.
 * code for bar courtesy of:
 * https://forum.arduino.cc/t/tft-progress-bar-wont-go-back-down/989189
 * some code pulled from isolation motion tracker pulled from:
 * https://www.instructables.com/Arduino-Motion-Tracker-From-Alien-Isolation/?fbclid=IwAR2P0H8tUwBisNGaP4C2vccz-fbBOlxxfdm8EIJJEHgAZnKOtgemeBjAZ3M
 * help found on arduino forums at https://arduino.cc
 */
 // Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#include <LcdProgressBar.h>
#include <LiquidCrystal.h>

// For the Adafruit shield, these are the default.
#define TFT_MISO 8
#define TFT_DC 9
#define TFT_CS 10
#define TFT_MOSI 11
#define TFT_CLK 12


// the colors are in a RGB565 format, so to get it you first need to grab it as a RGB888 and convert
//go here
//https://imagecolorpicker.com/en
//then here
//http://www.barth-dev.de/online/rgb565-color-picker/
// Assign human-readable names to some common 16-bit color values:
#define  BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF
#define DARKGREEN   0x03E0
#define OLIVE   0x7BE0
#define GREENYELLOW   0xAFE5
#define TEAL 0x263F
// button pins
//22 is a4, 23 is a5 on micro.
#define BUTTON_PIN_1 23
#define BUTTON_PIN_2 22
// pot pins are pins 14(a0) and 15(a1)
Bounce debouncer1 = Bounce();
Bounce debouncer2 = Bounce();
//global integer declarations
// arguments exist against global variables, however, they are nice if you use integers across functions
int rangelow;
int rangehigh;
int g1low = 80;
int g1high = 80;
int center;
int detect = 0;
int render = 0;
int b1 = 0;
int b2 = 0;
//invokation for the adafruit TFT
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_MISO);

void setup() {
  pinMode(A0, INPUT);
  tft.begin();
  tft.fillScreen(BLACK);
  tft.setRotation(1); //this sets 0,0 as the top left corner
//  txt(); //used to import screen settings from motion tracker code
  boot1();
  boot2();
  tft.fillScreen(BLACK);
  tft.setRotation(1);
// button initialization
  pinMode(BUTTON_PIN_1,INPUT_PULLUP); debouncer1.attach(BUTTON_PIN_1); debouncer1.interval(5);   
  pinMode(BUTTON_PIN_2,INPUT_PULLUP); debouncer2.attach(BUTTON_PIN_2); debouncer2.interval(25);
// sets up random number generator for game1 to game 2 transition
  randomSeed(analogRead(A3));
  center = random(150, 950);
  int myHeight = tft.height();
  int myWidth = tft.width();
}

void loop() {
  rangelow = center - g1low;
  rangehigh = center + g1high;
// comment out the bottom two lines and replace them with the below line to aid in calibrating your setup
// calibration();
  if (rangelow < analogRead(A0) &&  analogRead(A0) < rangehigh) { game2();}
  else { game1();   } //tft.fillRect(230, 40, 20, 20, BLACK);}
// declarations for buttons
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
  delay(20);
}

void calibration() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  int bar = map(analogRead(A0), 0, 1023, 0, 308);
  tft.fillRect(6, 80, bar, 44, RED);
  tft.fillRect(bar, 80, 308 - bar, 44, BLACK);
  tft.fillRect(0, 20, myWidth, 5, BLACK);
// draws pot number reading
  tft.setCursor(80,40);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(analogRead(A0));
// draws pot 2 number reading
  tft.setCursor(160,40);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(analogRead(A1));
// clears button status
  tft.fillRect(80, 140, 100, 30, BLACK);
   tft.fillRect(80, 180, 100, 30, BLACK);
  // add rendering pause
  delay(100);
  // clears drawings
  tft.fillRect(bar, 20, 20, 5, WHITE);
  tft.fillRect(80, 40, 200, 30, BLACK);
  game1();
//math for range sweetspot logic
  rangelow = center - g1low;
  rangehigh = center + g1high;
  if (rangelow < analogRead(A0) &&  analogRead(A0) < rangehigh) { tft.fillRect(230, 40, 20, 20, OLIVE); }
  else {tft.fillRect(230, 40, 20, 20, BLACK);}
// declarations for buttons
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
// draws button 2 status
  tft.setCursor(160,140);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(value2);
  // draws button 1 status
  tft.setCursor(80,140);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(value1);
  // draws pot 2 status
  tft.setCursor(160,180);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(rangelow);
  // draws pot 1 status
  tft.setCursor(80,180);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(rangehigh);
// clears text
  }

  void txt() {//Starting :)
  tft.fillScreen(BLACK);
  tft.setCursor(60, 20);
  tft.setTextColor(WHITE);
  tft.setTextSize(5);
  tft.println("B2-LAB");
  tft.setCursor(20, 80);
  tft.setTextColor(GREEN);
  tft.setTextSize(3);
  tft.println("MOTION-TRACKER");
  tft.setCursor(10,130);
  tft.setTextColor(RED);
  tft.setTextSize(2);
  tft.println("^VERTICAL WHEN OPERATING^");
  tft.setCursor(60, 150);
  tft.setTextColor(GREEN);
  tft.setTextSize(2);
  tft.print("Calibrate Sensors");
  tft.setCursor(10, 170);
  tft.setTextSize(3);
  for(int i=0;i<4;i++) { tft.print("."); delay(500); }
}

void boot1() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  byte progress = myWidth/8;
  int progress1;
  tft.fillScreen(BLACK);
  tft.setCursor(30, 10);
  tft.setTextColor(GREEN);
  tft.setTextSize(6);
  tft.println("SEEGSON");
  tft.drawRect(myWidth*2/16, myHeight*3/5, myWidth*12/16-5, 50, GREEN);
  for(int i=0;i<40;i++) {
    tft.fillRect(myWidth*2/16, myHeight*3/5, progress, 50, GREEN);
    tft.setTextSize(2);
    tft.setCursor(10, 100);
    tft.print("Progress =  ");
    tft.setTextSize(2);
    tft.setCursor(140, 100);
    progress1 = progress*17/40;
    tft.println(progress1);   
    delay(5);
    tft.fillRect(140, 100, 50, 20, BLACK);
    progress += 5;             
//    delay(5);     
  }
}

void boot2() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  tft.fillScreen(BLACK);
  tft.setCursor(myWidth*3/16, myHeight*9/12);
  tft.setTextColor(WHITE);
  tft.setTextSize(3);
  tft.print("Please wait");
  tft.drawRect(myWidth/2, myHeight*1/5, 5, 20, WHITE);
  delay(200);
  tft.drawRect(myWidth/2, myHeight*1/5, 5, 20, BLACK);
  tft.drawLine(myWidth*7/16, myHeight*3/12, myWidth*9/16, myHeight*1/12, WHITE);
  delay(200);
  tft.drawLine(myWidth*7/16, myHeight*3/12, myWidth*9/16, myHeight*1/12, BLACK);
 
  }

 
void game2() {
// declare variables for function
  int myHeight = tft.height();
  int myWidth = tft.width();
  int estcon;
  int senpak;
  int ovrpak;
// sets base text for game
  tft.setCursor(myWidth*3/16, myHeight*1/12);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("SYSTEM OVERRIDE");
  tft.setCursor(myWidth*4/16-10, myHeight*11/12);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("SECURITY FREQUENCY MATCH");
  tft.setCursor(myWidth*4/16, myHeight*12/12-10);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("V2.34 SYSTEM TEST");
  calibrate2();   
// the big minigame border
  tft.drawRect(3, myHeight*3/12, myWidth-9, myHeight*6/12, WHITE);
  tft.drawRect(6, myHeight*3/12, myWidth-15, myHeight*6/12, WHITE);
//  bar1();
  bar2();
  bar3();
 
 
// this rerenders based on button presses
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
  if (value2 == 0) { b2++; }
  if (value2 == 1 && analogRead(A1) > 440) { bar1(); }
  if (value2 == 1 && analogRead(A1) < 220) { bar1(); }
  if (value2 == 1 && 220 < analogRead(A1) < 440) { bar1(); } 
  if (value2 == 0 && analogRead(A1) > 440) { detect++; }
  if (value2 == 0 && analogRead(A1) < 220) { detect++; }
  if (value2 == 0 && 220 > analogRead(A1) && analogRead(A1) < 440) { pass1 = 1; }
  if (pass1 == 1) { passedbar1(); }
 
  if (value1 == 0) { b1++; }
  if (b1 == 5) { tft.fillScreen(TEAL); b1++; }
  if (b1 == 7) { b1 = 0; }
// This delays the redrawing of the entire screen
  render++; delay(10);
  if (render == 2) { tft.fillScreen(TEAL); render++; }
  if (render == 70) {  render = 0;  }
// rerender pieces set after delay

}

void game1() {
  int myHeight = tft.height(); int myWidth = tft.width();
// this is a delayed screen rerender   
  int render1;
  render1++;
  delay(10);
  if (render1 == 2) { tft.fillScreen(BLACK); render1++; }
  if (render1 == 40) { render1 = 0; }
  //I ended up having to separate out remaps for each side of the slider bar
 
  int bordw = map(analogRead(A0), 0, 1023, 0, 1023);
  int bordt = map(analogRead(A0), 0, 256, 0, myWidth);
  int bordrh = map(analogRead(A0), 256, 512, 0, myHeight);
  int bordb = map(analogRead(A0), 512, 768, myWidth, 0);
  int bordlh = map(analogRead(A0), 768, 1023, myHeight, 0);
 
//below greyed out was used to figure out logic of slider bar for game 1
/*
  // top border, right, bottom, left border bar
  if (1 < bordw < 256){ tft.fillRect(bordt, 0, 20, 5, WHITE); delay(100); tft.fillRect(0, 0, myWidth, 5, BLACK); }
  if (257 < bordw < 512){ tft.fillRect(myWidth -5, bordrh, 5, 20, WHITE); delay(100); tft.fillRect(myWidth -5, 0, 5, myHeight, BLACK); }
  if (512 < bordw < 768){ tft.fillRect(bordb, (myHeight - 5), 20, 5, WHITE); delay(100); tft.fillRect(0, (myHeight - 5), myWidth, 5, BLACK); }
  if (768 < bordw < 1023){ tft.fillRect(0, bordlh, 5, 20, WHITE); delay(100); tft.fillRect(0, 0, 5, myHeight, BLACK); }
  */
// after figuring out logic I tested to see if just simplifying and condensing the statements without if cases would work (it worked.)
  tft.fillRect(bordt, 0, 20, 5, WHITE);         
  tft.fillRect(myWidth -5, bordrh, 5, 20, WHITE);   
  tft.fillRect(bordb, (myHeight - 5), 20, 5, WHITE);
  tft.fillRect(0, bordlh, 5, 20, WHITE);
  delay(10);
  tft.fillRect(0, 0, 5, myHeight, BLACK);
  tft.fillRect(0, 0, myWidth, 5, BLACK);
  tft.fillRect(myWidth -5, 0, 5, myHeight, BLACK);
  tft.fillRect(0, (myHeight - 5), myWidth, 5, BLACK);
// center box
// yellow border
  tft.drawRect(myWidth*2/16 -8, myHeight*4/12, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -7, myHeight*4/12-1, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -6, myHeight*4/12-2, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -5, myHeight*4/12-3, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -4, myHeight*4/12-4, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -3, myHeight*4/12-5, myWidth*13/16+12, myHeight*4/12, YELLOW);
// text segments
  tft.setCursor(myWidth*2/16, myHeight*5/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("INCORRECT CODE");
  tft.setCursor(myWidth*2/16, myHeight*7/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("SYSTEM DETECTIONS");
  tft.setCursor(myWidth*13/16, myHeight*7/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print(detect);
  tft.setCursor(myWidth*13/16+12, myHeight*7/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("/3");
}

void bar1(){
  int myHeight = tft.height(); int myWidth = tft.width();
  int estcon;
  // bar 1 override takes reading from slider pot and draws the bar
  tft.setCursor(20, myHeight*3/12+5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Establishing Connection");
  estcon = map(analogRead(A1), 0, 1023, 10, 295);
  tft.fillRect(estcon, myHeight*4/12 , 5, 15, WHITE);
// redraws left of the slider
  tft.fillRect(9, myHeight*4/12, estcon-1, 15, TEAL);
// redraws right of the slider
  tft.fillRect(estcon+12, myHeight*4/12, myWidth-estcon-30, 15, TEAL);
// these are the static vertical lines on the bar
  tft.drawRect(9, myHeight*4/12, myWidth-30, 15, WHITE);
  tft.drawRect(myWidth-60, myHeight*4/12, 30, 15, WHITE);
  tft.drawLine(myWidth-60, myHeight*3/15+3, myWidth-45, myHeight*4/12-10, GREEN);
  tft.drawLine(myWidth-45, myHeight*4/12-10, myWidth, myHeight*2/12, GREEN);
  tft.drawRect(myWidth*4/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16+10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16+10, myHeight*4/12, 4, 15, WHITE);   
  tft.drawRect(myWidth*6/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*6/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*6/16+10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*7/16, myHeight*4/12, 4, 15, WHITE);   
}
void bar2() {
  int myHeight = tft.height(); int myWidth = tft.width();
  int senpak;
  // bar 2 override takes reading from slider pot and draws the bar
  tft.setCursor(20, myHeight*5/12+5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Sending Packets");
  senpak = map(analogRead(A1), 0, 1023, 10, 295);
  tft.fillRect(senpak, myHeight*6/12 , 5, 15, WHITE);
// redraws left of the slider
  tft.fillRect(9, myHeight*6/12, senpak-1, 15, TEAL);
// redraws right of the slider
  tft.fillRect(senpak+12, myHeight*6/12, myWidth-senpak-30, 15, TEAL);
// draws lines
  tft.drawRect(9, myHeight*6/12, myWidth-30, 15, WHITE);
  tft.drawRect(myWidth*3/16-10, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*3/16+10, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*3/16, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16-10, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16+10, myHeight*6/12, 4, 15, WHITE);
}
void bar3(){
  int myHeight = tft.height(); int myWidth = tft.width();
  int ovrpak;
  //bar 3
  tft.setCursor(20, myHeight*7/12+5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Overriding Protocol");
  ovrpak = map(analogRead(A1), 0, 1023, 10, 295);
  tft.fillRect(ovrpak, myHeight*8/12 , 5, 15, WHITE);
// redraws left of the slider
  tft.fillRect(9, myHeight*8/12, ovrpak-1, 15, TEAL);
// redraws right of the slider
  tft.fillRect(ovrpak+12, myHeight*8/12, myWidth-ovrpak-30, 15, TEAL);
// draws lines
  tft.drawRect(9, myHeight*8/12, myWidth-30, 15, WHITE);
  tft.drawRect(myWidth*3/16-10, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*3/16+10, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*3/16, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16-10, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16+10, myHeight*8/12, 4, 15, WHITE);
   
}
void calibrate2(){
  int myHeight = tft.height(); int myWidth = tft.width();
  // calibration testing
  tft.setCursor(myWidth*4/16, myHeight*10/12-10);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.println(analogRead(A1));
// declarations for buttons
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
// draws button 2 status
  tft.setCursor(myWidth*6/16, myHeight*10/12-10);
  tft.setTextColor(RED);
  tft.setTextSize(1);
  tft.println(value2);
  // draws button 1 status
  tft.setCursor(myWidth*8/16, myHeight*10/12-10);
  tft.setTextColor(OLIVE);
  tft.setTextSize(1);
  tft.println(value1);
  delay(10);
  tft.fillRect(myWidth*4/16, myHeight*10/12-10, 100, 20, TEAL);
// end calibration testing section
}

void passedbar1(){
  int myHeight = tft.height(); int myWidth = tft.width();
//  int estcon;
  // bar 1 override takes reading from slider pot and draws the bar
  tft.setCursor(20, myHeight*3/12+5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Established Connection");
//  estcon = map(analogRead(A1), 0, 1023, 10, 295);
//  tft.fillRect(estcon, myHeight*4/12 , 5, 15, WHITE);
// redraws left of the slider
//  tft.fillRect(9, myHeight*4/12, estcon-1, 15, TEAL);
// redraws right of the slider
//  tft.fillRect(estcon+12, myHeight*4/12, myWidth-estcon-30, 15, TEAL);
// these are the static vertical lines on the bar
  tft.drawRect(9, myHeight*4/12, myWidth-30, 15, WHITE);
  tft.drawRect(myWidth*4/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16+10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16+10, myHeight*4/12, 4, 15, WHITE);   
  tft.drawRect(myWidth*6/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*6/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*6/16+10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*7/16, myHeight*4/12, 4, 15, WHITE);   
}

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject: Re: security access tuner from alien isolation
PostPosted: Mon Feb 13, 2023 12:30 am 

Service Number: A05/TQ2.0.32141E1
Country: United States
got some of the logic added and some graphics tweaks:

Code:
/*Libraries provided by adafruit written by Lady Ada Fried.
 *Please stick to adafruit products as chinese knock offs are very,
 *very, very, very, very, very problematic.
 * code for bar courtesy of:
 * https://forum.arduino.cc/t/tft-progress-bar-wont-go-back-down/989189
 * some code pulled from isolation motion tracker pulled from:
 * https://www.instructables.com/Arduino-Motion-Tracker-From-Alien-Isolation/?fbclid=IwAR2P0H8tUwBisNGaP4C2vccz-fbBOlxxfdm8EIJJEHgAZnKOtgemeBjAZ3M
 * help found on arduino forums at https://arduino.cc
 */
 // Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#include <LcdProgressBar.h>
#include <LiquidCrystal.h>

// For the Adafruit shield, these are the default.
#define TFT_MISO 8
#define TFT_DC 9
#define TFT_CS 10
#define TFT_MOSI 11
#define TFT_CLK 12


// the colors are in a RGB565 format, so to get it you first need to grab it as a RGB888 and convert
//go here
//https://imagecolorpicker.com/en
//then here
//http://www.barth-dev.de/online/rgb565-color-picker/
// Assign human-readable names to some common 16-bit color values:
#define  BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF
#define DARKGREEN   0x03E0
#define OLIVE   0x7BE0
#define GREENYELLOW   0xAFE5
#define TEAL 0x263F
// button pins
//22 is a4, 23 is a5 on micro.
#define BUTTON_PIN_1 23
#define BUTTON_PIN_2 22
// pot pins are pins 14(a0) and 15(a1)
Bounce debouncer1 = Bounce();
Bounce debouncer2 = Bounce();
//global integer declarations
// arguments exist against global variables, however, they are nice if you use integers across functions
int rangelow;
int rangehigh;
int g1low = 80;
int g1high = 80;
int center;
int detect = 0;
int render = 0;
int b1 = 0;
int b2 = 0;
//invokation for the adafruit TFT
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_MISO);

void setup() {
  pinMode(A0, INPUT);
  tft.begin();
  tft.fillScreen(BLACK);
  tft.setRotation(1); //this sets 0,0 as the top left corner
//  txt(); //used to import screen settings from motion tracker code
  boot1();
  boot2();
  tft.fillScreen(BLACK);
  tft.setRotation(1);
// button initialization
  pinMode(BUTTON_PIN_1,INPUT_PULLUP); debouncer1.attach(BUTTON_PIN_1); debouncer1.interval(5);   
  pinMode(BUTTON_PIN_2,INPUT_PULLUP); debouncer2.attach(BUTTON_PIN_2); debouncer2.interval(25);
// sets up random number generator for game1 to game 2 transition
  randomSeed(analogRead(A3));
  center = random(150, 950);
  int myHeight = tft.height();
  int myWidth = tft.width();
}

void loop() {
  rangelow = center - g1low;
  rangehigh = center + g1high;
// comment out the bottom two lines and replace them with the below line to aid in calibrating your setup
// calibration();
  if (rangelow < analogRead(A0) &&  analogRead(A0) < rangehigh) { game2();}
  else { game1();   } //tft.fillRect(230, 40, 20, 20, BLACK);}
// declarations for buttons
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
  delay(20);
}

void calibration() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  int bar = map(analogRead(A0), 0, 1023, 0, 308);
  tft.fillRect(6, 80, bar, 44, RED);
  tft.fillRect(bar, 80, 308 - bar, 44, BLACK);
  tft.fillRect(0, 20, myWidth, 5, BLACK);
// draws pot number reading
  tft.setCursor(80,40);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(analogRead(A0));
// draws pot 2 number reading
  tft.setCursor(160,40);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(analogRead(A1));
// clears button status
  tft.fillRect(80, 140, 100, 30, BLACK);
   tft.fillRect(80, 180, 100, 30, BLACK);
  // add rendering pause
  delay(100);
  // clears drawings
  tft.fillRect(bar, 20, 20, 5, WHITE);
  tft.fillRect(80, 40, 200, 30, BLACK);
  game1();
//math for range sweetspot logic
  rangelow = center - g1low;
  rangehigh = center + g1high;
  if (rangelow < analogRead(A0) &&  analogRead(A0) < rangehigh) { tft.fillRect(230, 40, 20, 20, OLIVE); }
  else {tft.fillRect(230, 40, 20, 20, BLACK);}
// declarations for buttons
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
// draws button 2 status
  tft.setCursor(160,140);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(value2);
  // draws button 1 status
  tft.setCursor(80,140);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(value1);
  // draws pot 2 status
  tft.setCursor(160,180);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(rangelow);
  // draws pot 1 status
  tft.setCursor(80,180);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(rangehigh);
// clears text
  }

  void txt() {//Starting :)
  tft.fillScreen(BLACK);
  tft.setCursor(60, 20);
  tft.setTextColor(WHITE);
  tft.setTextSize(5);
  tft.println("B2-LAB");
  tft.setCursor(20, 80);
  tft.setTextColor(GREEN);
  tft.setTextSize(3);
  tft.println("MOTION-TRACKER");
  tft.setCursor(10,130);
  tft.setTextColor(RED);
  tft.setTextSize(2);
  tft.println("^VERTICAL WHEN OPERATING^");
  tft.setCursor(60, 150);
  tft.setTextColor(GREEN);
  tft.setTextSize(2);
  tft.print("Calibrate Sensors");
  tft.setCursor(10, 170);
  tft.setTextSize(3);
  for(int i=0;i<4;i++) { tft.print("."); delay(500); }
}

void boot1() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  byte progress = myWidth/8;
  int progress1;
  tft.fillScreen(BLACK);
  tft.setCursor(30, 10);
  tft.setTextColor(GREEN);
  tft.setTextSize(6);
  tft.println("SEEGSON");
  tft.drawRect(myWidth*2/16, myHeight*3/5, myWidth*12/16-5, 50, GREEN);
  for(int i=0;i<40;i++) {
    tft.fillRect(myWidth*2/16, myHeight*3/5, progress, 50, GREEN);
    tft.setTextSize(2);
    tft.setCursor(myWidth*4/16, myHeight*5/12);
    tft.print("Progress  ");
    tft.setTextSize(2);
    tft.setCursor(myWidth*5/8, myHeight*5/12);
    progress1 = progress*17/40;
    tft.print(progress1);   
    delay(5);
    tft.fillRect(myWidth*9/16, myHeight*5/12, myHeight*5/12, 20, BLACK);
    progress += 5;                 
  }
}

void boot2() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  tft.fillScreen(BLACK);
  tft.setCursor(myWidth*3/16, myHeight*9/12);
  tft.setTextColor(WHITE);
  tft.setTextSize(3);
  tft.print("Please wait");
  tft.drawRect(myWidth/2, myHeight*1/5, 5, 20, WHITE);
  delay(200);
  tft.drawRect(myWidth/2, myHeight*1/5, 5, 20, BLACK);
  tft.drawLine(myWidth*7/16, myHeight*3/12, myWidth*9/16, myHeight*1/12, WHITE);
  delay(200);
  tft.drawLine(myWidth*7/16, myHeight*3/12, myWidth*9/16, myHeight*1/12, BLACK);
 
  }

 
void game2() {
// declare variables for function
  int myHeight = tft.height();
  int myWidth = tft.width();
  int estcon;
  int senpak;
  int ovrpak;
// sets base text for game
  tft.setCursor(myWidth*3/16, myHeight*1/12);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("SYSTEM OVERRIDE");
  tft.setCursor(myWidth*4/16-10, myHeight*11/12);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("SECURITY FREQUENCY MATCH");
  tft.setCursor(myWidth*4/16, myHeight*12/12-10);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("V2.34 SYSTEM TEST");
  calibrate2();   
// the big minigame border
  tft.drawRect(3, myHeight*3/12, myWidth-9, myHeight*6/12, WHITE);
  tft.drawRect(6, myHeight*3/12, myWidth-15, myHeight*6/12, WHITE);
//  bar1();
  bar2();
  bar3();
 
int pass1;
// this rerenders based on button presses
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
  if (value2 == 0) { b2++; }
  if (value2 == 1 && analogRead(A1) > 440) { bar1(); }
  if (value2 == 1 && analogRead(A1) < 220) { bar1(); }
  if (value2 == 1 && 220 < analogRead(A1) < 440) { bar1(); }
  if (value2 == 0 && analogRead(A1) > 440) { detect++; }
  if (value2 == 0 && analogRead(A1) < 220) { detect++; }
  if (value2 == 0 && 220 > analogRead(A1) && analogRead(A1) < 440) { pass1 = 1; }
  if (pass1 == 1) { passedbar1(); }
 
  if (value1 == 0) { b1++; }
  if (b1 == 5) { tft.fillScreen(TEAL); b1++; }
  if (b1 == 7) { b1 = 0; }
// This delays the redrawing of the entire screen
  render++; delay(10);
  if (render == 2) { tft.fillScreen(TEAL); render++; }
  if (render == 70) {  render = 0;  }
// rerender pieces set after delay

}

void game1() {
  int myHeight = tft.height(); int myWidth = tft.width();
// this is a delayed screen rerender   
  int render1;
  render1++;
  delay(10);
  if (render1 == 2) { tft.fillScreen(BLACK); render1++; }
  if (render1 == 40) { render1 = 0; }
  //I ended up having to separate out remaps for each side of the slider bar
 
  int bordw = map(analogRead(A0), 0, 1023, 0, 1023);
  int bordt = map(analogRead(A0), 0, 256, 0, myWidth);
  int bordrh = map(analogRead(A0), 256, 512, 0, myHeight);
  int bordb = map(analogRead(A0), 512, 768, myWidth, 0);
  int bordlh = map(analogRead(A0), 768, 1023, myHeight, 0);
 
//below greyed out was used to figure out logic of slider bar for game 1
/*
  // top border, right, bottom, left border bar
  if (1 < bordw < 256){ tft.fillRect(bordt, 0, 20, 5, WHITE); delay(100); tft.fillRect(0, 0, myWidth, 5, BLACK); }
  if (257 < bordw < 512){ tft.fillRect(myWidth -5, bordrh, 5, 20, WHITE); delay(100); tft.fillRect(myWidth -5, 0, 5, myHeight, BLACK); }
  if (512 < bordw < 768){ tft.fillRect(bordb, (myHeight - 5), 20, 5, WHITE); delay(100); tft.fillRect(0, (myHeight - 5), myWidth, 5, BLACK); }
  if (768 < bordw < 1023){ tft.fillRect(0, bordlh, 5, 20, WHITE); delay(100); tft.fillRect(0, 0, 5, myHeight, BLACK); }
  */
// after figuring out logic I tested to see if just simplifying and condensing the statements without if cases would work (it worked.)
  tft.fillRect(bordt, 0, 20, 5, WHITE);         
  tft.fillRect(myWidth -5, bordrh, 5, 20, WHITE);   
  tft.fillRect(bordb, (myHeight - 5), 20, 5, WHITE);
  tft.fillRect(0, bordlh, 5, 20, WHITE);
  delay(10);
  tft.fillRect(0, 0, 5, myHeight, BLACK);
  tft.fillRect(0, 0, myWidth, 5, BLACK);
  tft.fillRect(myWidth -5, 0, 5, myHeight, BLACK);
  tft.fillRect(0, (myHeight - 5), myWidth, 5, BLACK);
// center box
// yellow border
  tft.drawRect(myWidth*2/16 -8, myHeight*4/12, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -7, myHeight*4/12-1, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -6, myHeight*4/12-2, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -5, myHeight*4/12-3, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -4, myHeight*4/12-4, myWidth*13/16+12, myHeight*4/12, YELLOW);
  tft.drawRect(myWidth*2/16 -3, myHeight*4/12-5, myWidth*13/16+12, myHeight*4/12, YELLOW);
// text segments
  tft.setCursor(myWidth*2/16, myHeight*5/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("INCORRECT CODE");
  tft.setCursor(myWidth*2/16, myHeight*7/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("SYSTEM DETECTIONS");
  tft.setCursor(myWidth*13/16, myHeight*7/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print(detect);
  tft.setCursor(myWidth*13/16+12, myHeight*7/12 -10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("/3");
}

void bar1(){
  int myHeight = tft.height(); int myWidth = tft.width();
  int estcon;
  // bar 1 override takes reading from slider pot and draws the bar
  tft.setCursor(20, myHeight*3/12+5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Establishing Connection");
  estcon = map(analogRead(A1), 0, 1023, 10, 295);
  tft.fillRect(estcon, myHeight*4/12 , 5, 15, WHITE);
// redraws left of the slider
  tft.fillRect(9, myHeight*4/12, estcon-1, 15, TEAL);
// redraws right of the slider
  tft.fillRect(estcon+12, myHeight*4/12, myWidth-estcon-30, 15, TEAL);
// these are the static vertical lines on the bar
  tft.drawRect(9, myHeight*4/12, myWidth-30, 15, WHITE);
  tft.fillRect(myWidth-50, myHeight*4/12, 30, 15, WHITE);
  tft.drawRect(myWidth*4/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16+10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16+10, myHeight*4/12, 4, 15, WHITE);   
  tft.drawRect(myWidth*6/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*6/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*6/16+10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*7/16, myHeight*4/12, 4, 15, WHITE);   
}
void bar2() {
  int myHeight = tft.height(); int myWidth = tft.width();
  int senpak;
  // bar 2 override takes reading from slider pot and draws the bar
  tft.setCursor(20, myHeight*5/12+5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Sending Packets");
  senpak = map(analogRead(A1), 0, 1023, 10, 295);
  tft.fillRect(senpak, myHeight*6/12 , 5, 15, WHITE);
// redraws left of the slider
  tft.fillRect(9, myHeight*6/12, senpak-1, 15, TEAL);
// redraws right of the slider
  tft.fillRect(senpak+12, myHeight*6/12, myWidth-senpak-30, 15, TEAL);
// draws lines
  tft.drawRect(9, myHeight*6/12, myWidth-30, 15, WHITE);
  tft.drawRect(myWidth*3/16-10, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*3/16+10, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*3/16, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16-10, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16, myHeight*6/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16+10, myHeight*6/12, 4, 15, WHITE);
}
void bar3(){
  int myHeight = tft.height(); int myWidth = tft.width();
  int ovrpak;
  //bar 3
  tft.setCursor(20, myHeight*7/12+5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Overriding Protocol");
  ovrpak = map(analogRead(A1), 0, 1023, 10, 295);
  tft.fillRect(ovrpak, myHeight*8/12 , 5, 15, WHITE);
// redraws left of the slider
  tft.fillRect(9, myHeight*8/12, ovrpak-1, 15, TEAL);
// redraws right of the slider
  tft.fillRect(ovrpak+12, myHeight*8/12, myWidth-ovrpak-30, 15, TEAL);
// draws lines
  tft.drawRect(9, myHeight*8/12, myWidth-30, 15, WHITE);
  tft.drawRect(myWidth*3/16-10, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*3/16+10, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*3/16, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16-10, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16, myHeight*8/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16+10, myHeight*8/12, 4, 15, WHITE);
   
}
void calibrate2(){
  int myHeight = tft.height(); int myWidth = tft.width();
  // calibration testing
  tft.setCursor(myWidth*4/16, myHeight*10/12-10);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.println(analogRead(A1));
// declarations for buttons
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
// draws button 2 status
  tft.setCursor(myWidth*6/16, myHeight*10/12-10);
  tft.setTextColor(RED);
  tft.setTextSize(1);
  tft.println(value2);
  // draws button 1 status
  tft.setCursor(myWidth*8/16, myHeight*10/12-10);
  tft.setTextColor(OLIVE);
  tft.setTextSize(1);
  tft.println(value1);
  delay(10);
  tft.fillRect(myWidth*4/16, myHeight*10/12-10, 100, 20, TEAL);
// end calibration testing section
}

void passedbar1(){
  int myHeight = tft.height(); int myWidth = tft.width();
  // renders static bar once bar 1 passed checks
  tft.setCursor(20, myHeight*3/12+5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Established Connection");
  tft.drawRect(9, myHeight*4/12, myWidth-30, 15, WHITE);
  tft.fillRect(myWidth-50, myHeight*4/12, 30, 15, WHITE);
  tft.drawLine(myWidth-50, myHeight*4/12, myWidth-35, myHeight*5/12-10, GREEN);
  tft.drawLine(myWidth-49, myHeight*4/12, myWidth-34, myHeight*5/12-10, GREEN);
  tft.drawLine(myWidth-48, myHeight*4/12, myWidth-33, myHeight*5/12-10, GREEN);
  tft.drawLine(myWidth-47, myHeight*4/12, myWidth-32, myHeight*5/12-10, GREEN);
  tft.drawLine(myWidth-35, myHeight*5/12-10, myWidth*15/16+10, myHeight*3/12, GREEN);
  tft.drawLine(myWidth-34, myHeight*5/12-10, myWidth*15/16+9, myHeight*3/12, GREEN);
  tft.drawLine(myWidth-33, myHeight*5/12-10, myWidth*15/16+8, myHeight*3/12, GREEN);
  tft.drawLine(myWidth-32, myHeight*5/12-10, myWidth*15/16+7, myHeight*3/12, GREEN);
  tft.drawRect(myWidth*4/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16+10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*4/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*5/16+10, myHeight*4/12, 4, 15, WHITE);   
  tft.drawRect(myWidth*6/16-10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*6/16, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*6/16+10, myHeight*4/12, 4, 15, WHITE);
  tft.drawRect(myWidth*7/16, myHeight*4/12, 4, 15, WHITE);   
}

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Feb 19, 2023 10:56 pm 

Service Number: A05/TQ2.0.32141E1
Country: United States
I am hitting some roadblocks. As the firefox version I was using was deprecated I had to upgraded to the latest version of ubuntu on my laptop. That was a harrowing experience. Now I am trying to get updated to the latest version of arduino.ide. Linux is getting easier now a days. single file appimage files are akin to windows .exe files. flatpaks are akin to windows msi/exe installers.

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Feb 25, 2023 7:52 am 

Service Number: A05/TQ2.0.32141E1
Country: United States
OK, I got some more parts in, and, I order a wrong part :-(

The rotary encoder I ordered was a push button rotary encoder. This actually more closely matches the functonality of the access tuner in the game.

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject: Re: security access tuner from alien isolation
PostPosted: Sat Feb 25, 2023 11:11 pm 

Service Number: A05/TQ2.0.32141E1
Country: United States
OK I think I might have a structure figured out for a state machine.

Code:
enum {bar1test, bar1passed, bar2test, bar2passed, bar3test, bar3passed, gamewon};
unsigned char barstate = bar1test; 

switch (barstate)
  case bar1test:
  case bar1passed:
  case bar2test:
  case bar2passed:
  case bar3test:
  case bar3passed:
  case gamewon:


source:
https://forum.arduino.cc/t/question-on- ... 1089501/22

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject: Re: security access tuner from alien isolation
PostPosted: Sun Feb 26, 2023 12:32 pm 

Service Number: A05/TQ2.0.32141E1
Country: United States
And I have some state machine code to play with now

Code:
enum {initial, bar1test, bar1passed, bar2test, bar2passed, bar3test, bar3passed, gamewon, gamelost};
unsigned char barstate = initial; 
  rangelow = center - g1low;
  rangehigh = center + g1high;
pinMode(3, INPUT); digitalWrite(3, LOW);

switch (barstate)
  case initial;
    if (rangelow < analogRead(A0) &&  analogRead(A0) < rangehigh) { game2(); break;}
    else { game1(); break;   }
  case bar1test:
    if (value2 == 1 ) { bar1(); break; }
    else { bar1(); if (value2 == 0 && 220 > analogRead(A1) && analogRead(A1) < 440) { passedbar1(); barstate = bar1passed; break; }}
    if (value2 == 0 && 220 > analogRead(A1) && analogRead(A1) > 440) { bar1(); detect++; break; }
    if (value2 == 0 && analogRead(A1) < 220) { detect++; }
  case bar1passed:
    if (value2 == 1 ) { bar1passed(); bar2(); barstate=bar2test; break; }
  case bar2test:
    if (value2 == 1 ) { bar1passed(); bar2(); break; }
    if (value2 == 0 && 220 > analogRead(A1) && analogRead(A1) > 440) { bar1passed(); bar2(); detect++; break; }
    else { bar1passed(); bar2(); if (value2 == 0 && 220 > analogRead(A1) && analogRead(A1) < 440) { passedbar2(); barstate = bar2passed; break; }}
  case bar2passed:
    if (value2 == 1 ) { bar1passed(); bar2passed(); bar3(); barstate=bar3test; break; }
  case bar3test:
    if (value2 == 0 && 220 > analogRead(A1) && analogRead(A1) > 440) { detect++; break; }
    if (value2 == 1 ) { bar1passed(); bar2passed(); bar3(); break; }
    if (value2 == 0 && 220 > analogRead(A1) && analogRead(A1) > 440) { bar1passed(); bar2passed(); bar3(); detect++; break; }
  case bar3passed:
    if (value2 == 1 ) { bar1passed(); bar2passed(); bar3passed(); barstate=gamewon; break; }
  case gamewon:
    accessgranted();
    delay(1500);
    gamewon();
    delay(2000);
    pinMode(3, OUTPUT); //reset unit
  case gamelost:

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Mar 04, 2023 8:08 pm 

Service Number: A05/TQ2.0.32141E1
Country: United States
OK, access tuner screen was a dud. I am getting a 2.4" adafruit LCD on the way. The chinese one again is a non compatible piece of junk.

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject: Re:
PostPosted: Sat Mar 11, 2023 7:37 am 

Service Number: A05/TQ2.0.32141E1
Country: United States
knoxvilles_joker wrote:
OK, access tuner screen was a dud. I am getting a 2.4" adafruit LCD on the way. The chinese one again is a non compatible piece of junk.


I got the replacement in. I tried it in 8-bit mode and that would require a complete rewrite. I switched it over to SPI mode and it works like a charm. Old screen was definately a dud.

I have verified that the wiring and such all works.

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject: Re: security access tuner from alien isolation
PostPosted: Sat Mar 25, 2023 11:04 am 

Service Number: A05/TQ2.0.32141E1
Country: United States
Some progress pictures. I assembled things so I could make sure it all fit and worked.

IMG_5607.JPG
IMG_5607.JPG [ 1.91 MiB | Viewed 1032 times ]

IMG_5606.JPG
IMG_5606.JPG [ 1.75 MiB | Viewed 1032 times ]

IMG_5605.JPG
IMG_5605.JPG [ 1.24 MiB | Viewed 1032 times ]

IMG_5604.JPG
IMG_5604.JPG [ 1.22 MiB | Viewed 1032 times ]

IMG_5602.JPG
IMG_5602.JPG [ 1.42 MiB | Viewed 1032 times ]


_________________
The impossible takes a while longer and goes over budget too...
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Mar 26, 2023 8:52 pm 

Service Number: A05/TQ2.0.32141E1
Country: United States
OK, I finally got the logic piece sorted. I just have to build two more screens and then fine tune and perfect the looks.

IMG_5611.JPG
IMG_5611.JPG [ 2 MiB | Viewed 1018 times ]


_________________
The impossible takes a while longer and goes over budget too...
Top
 Profile  
Reply with quote  
 Post subject: Re: security access tuner from alien isolation
PostPosted: Mon Mar 27, 2023 1:27 am 

Service Number: A05/TQ2.0.32141E1
Country: United States
ok this is a complete game. Just not completely finished just yet:

Code:
/*Libraries provided by adafruit written by Lady Ada Fried.
 *Please stick to adafruit products as chinese knock offs are very,
 *very, very, very, very, very problematic.
 * code for bar courtesy of:
 * https://forum.arduino.cc/t/tft-progress-bar-wont-go-back-down/989189
 * some code pulled from isolation motion tracker pulled from:
 * https://www.instructables.com/Arduino-Motion-Tracker-From-Alien-Isolation/?fbclid=IwAR2P0H8tUwBisNGaP4C2vccz-fbBOlxxfdm8EIJJEHgAZnKOtgemeBjAZ3M
 * help found on arduino forums at https://arduino.cc
 */
// Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#include <LcdProgressBar.h>
#include <LiquidCrystal.h>

// For the Adafruit shield, these are the default.
// USE hardware SPI pins. 
#define TFT_DC 9
#define TFT_CS 10
// the colors are in a RGB565 format, so to get it you first need to grab it as a RGB888 and convert
//go here
//https://imagecolorpicker.com/en
//then here
//http://www.barth-dev.de/online/rgb565-color-picker/
// Assign human-readable names to some common 16-bit color values:
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
#define DARKGREEN 0x03E0
#define OLIVE 0x7BE0
#define GREENYELLOW 0xAFE5
#define TEAL 0x263F
// button pins
//22 is a4, 23 is a5 on micro.
#define BUTTON_PIN_1 A5
#define BUTTON_PIN_2 A4
// pot pins are pins 14(a0) and 15(a1)
Bounce debouncer1 = Bounce(); Bounce debouncer2 = Bounce();
enum { initial, bar1test, bar1passed1, bar2test, bar2passed1, bar3test, bar3passed1, gamewon, gamelost };
unsigned char barstate = bar1test;
//global integer declarations
// arguments exist against global variables, however, they are nice if you use integers across functions
int rangelow;
int rangehigh;
int g1low = 80;
int g1high = 80;
int center;
int detect = 0;
int render = 0;
int b1 = 0;
int b2 = 0;

//invokation for the adafruit TFT
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);  //, TFT_MOSI, TFT_CLK, TFT_MISO);

void setup() {
  pinMode(3, INPUT);
  digitalWrite(3, LOW);
  pinMode(A0, INPUT);
  tft.begin();
  tft.fillScreen(BLACK);
  tft.setRotation(1);  //this sets 0,0 as the top left corner
                       //  txt(); //used to import screen settings from motion tracker code
  boot1();
  boot2();
  tft.fillScreen(BLACK);
  tft.setRotation(1);
  // button initialization
  pinMode(BUTTON_PIN_1, INPUT_PULLUP);
  debouncer1.attach(BUTTON_PIN_1);
  debouncer1.interval(5);
  pinMode(BUTTON_PIN_2, INPUT_PULLUP);
  debouncer2.attach(BUTTON_PIN_2);
  debouncer2.interval(25);
  // sets up random number generator for game1 to game 2 transition
  randomSeed(analogRead(A3));
  center = random(150, 950);
  //  int myHeight = tft.height();
  //int myWidth = tft.width();
}

void loop() {
  rangelow = center - g1low;
  rangehigh = center + g1high;
  // comment out the bottom two lines and replace them with the below line to aid in calibrating your setup
  // calibration();
  if (rangelow < analogRead(A0) && analogRead(A0) < rangehigh) {

    game2();
 
    }
      else {
   
        game1();
   
        }  //tft.fillRect(230, 40, 20, 20, BLACK);}
     // declarations for buttons
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
  delay(20);
}

void calibration() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  int bar = map(analogRead(A0), 0, 1023, 0, 308);
  tft.fillRect(6, 80, bar, 44, RED);
  tft.fillRect(bar, 80, 308 - bar, 44, BLACK);
  tft.fillRect(0, 20, myWidth, 5, BLACK);
  // draws pot number reading
  tft.setCursor(80, 40);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(analogRead(A0));
  // draws pot 2 number reading
  tft.setCursor(160, 40);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(analogRead(A1));
  // clears button status
  tft.fillRect(80, 140, 100, 30, BLACK);
  tft.fillRect(80, 180, 100, 30, BLACK);
  // add rendering pause
  delay(100);
  // clears drawings
  tft.fillRect(bar, 20, 20, 5, WHITE);
  tft.fillRect(80, 40, 200, 30, BLACK);
  game1();
  //math for range sweetspot logic
  rangelow = center - g1low;
  rangehigh = center + g1high;
  if (rangelow < analogRead(A0) && analogRead(A0) < rangehigh) {
    tft.fillRect(230, 40, 20, 20, OLIVE);
  } else {
    tft.fillRect(230, 40, 20, 20, BLACK);
  }
  // declarations for buttons
  debouncer1.update();
  debouncer2.update();
  int value1 = debouncer1.read();
  int value2 = debouncer2.read();
  // draws button 2 status
  tft.setCursor(160, 140);
  tft.setTextColor(RED);
  tft.setTextSize(3);
  tft.println(value2);
  // draws button 1 status
  tft.setCursor(80, 140);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(value1);
  // draws pot 2 status
  tft.setCursor(160, 180);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(rangelow);
  // draws pot 1 status
  tft.setCursor(80, 180);
  tft.setTextColor(OLIVE);
  tft.setTextSize(3);
  tft.println(rangehigh);
  // clears text
}

void txt() {  //Starting :)
  tft.fillScreen(BLACK);
  tft.setCursor(60, 20);
  tft.setTextColor(WHITE);
  tft.setTextSize(5);
  tft.println("B2-LAB");
  tft.setCursor(20, 80);
  tft.setTextColor(GREEN);
  tft.setTextSize(3);
  tft.println("MOTION-TRACKER");
  tft.setCursor(10, 130);
  tft.setTextColor(RED);
  tft.setTextSize(2);
  tft.println("^VERTICAL WHEN OPERATING^");
  tft.setCursor(60, 150);
  tft.setTextColor(GREEN);
  tft.setTextSize(2);
  tft.print("Calibrate Sensors");
  tft.setCursor(10, 170);
  tft.setTextSize(3);
  for (int i = 0; i < 4; i++) {
    tft.print(".");
    delay(500);
  }
}

void boot1() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  byte progress = myWidth / 8;
  int progress1;
  tft.fillScreen(BLACK);
  tft.setCursor(30, 10);
  tft.setTextColor(GREEN);
  tft.setTextSize(6);
  tft.println("SEEGSON");
  tft.drawRect(myWidth * 2 / 16, myHeight * 3 / 5, myWidth * 12 / 16 - 5, 50, GREEN);
  for (int i = 0; i < 40; i++) {
    tft.fillRect(myWidth * 2 / 16, myHeight * 3 / 5, progress, 50, GREEN);
    tft.setTextSize(2);
    tft.setCursor(myWidth * 4 / 16, myHeight * 5 / 12);
    tft.print("Progress  ");
    tft.setTextSize(2);
    tft.setCursor(myWidth * 5 / 8, myHeight * 5 / 12);
    progress1 = progress * 17 / 40;
    tft.print(progress1);
    delay(5);
    tft.fillRect(myWidth * 9 / 16, myHeight * 5 / 12, myHeight * 5 / 12, 20, BLACK);
    progress += 5;
  }
}

void boot2() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  tft.fillScreen(BLACK);
  tft.setCursor(myWidth * 3 / 16, myHeight * 9 / 12);
  tft.setTextColor(WHITE);
  tft.setTextSize(3);
  tft.print("Please wait");
  tft.drawRect(myWidth / 2, myHeight * 1 / 5, 5, 20, WHITE);
  delay(200);
  tft.drawRect(myWidth / 2, myHeight * 1 / 5, 5, 20, BLACK);
  tft.drawLine(myWidth * 7 / 16, myHeight * 3 / 12, myWidth * 9 / 16, myHeight * 1 / 12, WHITE);
  delay(200);
  tft.drawLine(myWidth * 7 / 16, myHeight * 3 / 12, myWidth * 9 / 16, myHeight * 1 / 12, BLACK);
  tft.drawLine(myWidth * 7 / 16, myHeight * 2 / 12, myWidth * 9 / 16, myHeight * 1 / 12, WHITE);
  delay(200);
  tft.drawLine(myWidth * 7 / 16, myHeight * 2 / 12, myWidth * 9 / 16, 5, BLACK);
}


void game2() {
  // declare variables for function
  int myHeight = tft.height();
  int myWidth = tft.width();
  int estcon;
  int senpak;
  int ovrpak;
  // sets base text for game
  tft.setCursor(myWidth * 3 / 16, myHeight * 1 / 12);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("SYSTEM OVERRIDE");
  tft.setCursor(myWidth * 4 / 16 - 10, myHeight * 11 / 12);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("SECURITY FREQUENCY MATCH");
  tft.setCursor(myWidth * 4 / 16, myHeight * 12 / 12 - 10);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("V2.34 SYSTEM TEST");
  calibrate2();
  // the big minigame border
  tft.drawRect(3, myHeight * 3 / 12, myWidth - 9, myHeight * 6 / 12, WHITE);
  tft.drawRect(6, myHeight * 3 / 12, myWidth - 15, myHeight * 6 / 12, WHITE);
  int pass1;
  // this rerenders based on button presses
  debouncer1.update(); debouncer2.update(); int value1 = debouncer1.read(); int value2 = debouncer2.read();
 
  switch (barstate) {
    case bar1test:
      bar1();
      if (value2 == 0 && 220 < analogRead(A1) && analogRead(A1) < 440) { barstate = bar1passed1; break; }
      if (value2 == 0 && 220 > analogRead(A1) && analogRead(A1) > 440) {detect++; break; }
      if (value2 == 0  && detect == 3 ) { barstate = gamelost; break; }     
      break;
    case bar1passed1:
      passedbar1(); bar2(); barstate = bar2test; break;
    case bar2test:
      passedbar1(); bar2();
      if (value2 == 0 && 140 < analogRead(A1) && analogRead(A1) < 280) { barstate = bar2passed1; break; }   
      if (value2 == 0 && 140 > analogRead(A1) && analogRead(A1) > 280) { detect++; break; }
      if (value2 == 0 && detect == 3) { barstate = gamelost; break; }
      break;
    case bar2passed1:
        passedbar1(); passedbar2(); bar3(); barstate = bar3test; break;
    case bar3test:
      passedbar1(); passedbar2(); bar3();
      if (value2 == 0 && 720 > analogRead(A1) && analogRead(A1) > 870) { detect++; break;}     
      if (value2 == 0 && 720 < analogRead(A1) && analogRead(A1) < 870) { barstate = bar3passed1; break; }
      if (value2 == 0 && detect == 3) { barstate = gamelost; break; }
      break;
    case bar3passed1:
        passedbar1(); passedbar2(); passedbar3(); barstate = gamewon; break;
    case gamewon:
      accessgranted();
      delay(2000);
      gamewon1();
      delay(2000);
      pinMode(3, OUTPUT);  //reset unit
      break;
    case gamelost:
      gamelost1();
      break;
  }

  // this is a rerender section
  if (value1 == 0) { b1++; }
  if (b1 == 5) {
    tft.fillScreen(TEAL);
    b1++;
  }
  if (b1 == 7) { b1 = 0; }  //

  //  This delays the redrawing of the entire screen
  render++;
  delay(10);
  if (render == 2) {
    tft.fillScreen(TEAL);
    render++;
  }
  if (render == 70) { render = 0; }
  // rerender pieces set after delay
}

void game1() {
  debouncer1.update();
  debouncer2.update();
  int value1 = debouncer1.read();
  int value2 = debouncer2.read();
  int myHeight = tft.height();
  int myWidth = tft.width();
  // this is a delayed screen rerender
  int render1;
  render1++;
  delay(10);
  if (render1 == 2) {
    tft.fillScreen(BLACK);
    render1++;
  }
  if (render1 == 40) { render1 = 0; }
  //I ended up having to separate out remaps for each side of the slider bar

  int bordw = map(analogRead(A0), 0, 1023, 0, 1023);
  int bordt = map(analogRead(A0), 0, 256, 0, myWidth);
  int bordrh = map(analogRead(A0), 256, 512, 0, myHeight);
  int bordb = map(analogRead(A0), 512, 768, myWidth, 0);
  int bordlh = map(analogRead(A0), 768, 1023, myHeight, 0);
  tft.fillRect(bordt, 0, 20, 5, WHITE);
  tft.fillRect(myWidth - 5, bordrh, 5, 20, WHITE);
  tft.fillRect(bordb, (myHeight - 5), 20, 5, WHITE);
  tft.fillRect(0, bordlh, 5, 20, WHITE);
  delay(10);
  tft.fillRect(0, 0, 5, myHeight, BLACK);
  tft.fillRect(0, 0, myWidth, 5, BLACK);
  tft.fillRect(myWidth - 5, 0, 5, myHeight, BLACK);
  tft.fillRect(0, (myHeight - 5), myWidth, 5, BLACK);
  // center box
  // yellow border
  tft.drawRect(myWidth * 2 / 16 - 8, myHeight * 4 / 12, myWidth * 13 / 16 + 12, myHeight * 4 / 12, YELLOW);
  tft.drawRect(myWidth * 2 / 16 - 7, myHeight * 4 / 12 - 1, myWidth * 13 / 16 + 12, myHeight * 4 / 12, YELLOW);
  tft.drawRect(myWidth * 2 / 16 - 6, myHeight * 4 / 12 - 2, myWidth * 13 / 16 + 12, myHeight * 4 / 12, YELLOW);
  tft.drawRect(myWidth * 2 / 16 - 5, myHeight * 4 / 12 - 3, myWidth * 13 / 16 + 12, myHeight * 4 / 12, YELLOW);
  tft.drawRect(myWidth * 2 / 16 - 4, myHeight * 4 / 12 - 4, myWidth * 13 / 16 + 12, myHeight * 4 / 12, YELLOW);
  tft.drawRect(myWidth * 2 / 16 - 3, myHeight * 4 / 12 - 5, myWidth * 13 / 16 + 12, myHeight * 4 / 12, YELLOW);
  // text segments
  tft.setCursor(myWidth * 2 / 16, myHeight * 5 / 12 - 10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("INCORRECT CODE");
  tft.setCursor(myWidth * 2 / 16, myHeight * 7 / 12 - 10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("SYSTEM DETECTIONS");
  tft.setCursor(myWidth * 13 / 16, myHeight * 7 / 12 - 10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print(detect);
  tft.setCursor(myWidth * 13 / 16 + 12, myHeight * 7 / 12 - 10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("/3");

  // this is a rerender section
  if (value1 == 0) { b1++; }
  if (b1 == 5) {
    tft.fillScreen(BLACK);
    b1++;
  }
  if (b1 == 7) { b1 = 0; }
 
}

void bar1() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  int estcon;
  // bar 1 override takes reading from slider pot and draws the bar
  tft.setCursor(20, myHeight * 3 / 12 + 5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Establishing Connection");
  estcon = map(analogRead(A1), 0, 1023, 10, 295);
  tft.fillRect(estcon, myHeight * 4 / 12, 5, 15, WHITE);
  // redraws left of the slider
  tft.fillRect(9, myHeight * 4 / 12, estcon - 1, 15, TEAL);
  // redraws right of the slider
  tft.fillRect(estcon + 12, myHeight * 4 / 12, myWidth - estcon - 30, 15, TEAL);
  // these are the static vertical lines on the bar
  tft.drawRect(9, myHeight * 4 / 12, myWidth - 30, 15, WHITE);
  tft.fillRect(myWidth - 50, myHeight * 4 / 12, 30, 15, WHITE);
  tft.drawRect(myWidth * 4 / 16 - 10, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 4 / 16 + 10, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 4 / 16, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 5 / 16 - 10, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 5 / 16, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 5 / 16 + 10, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 6 / 16 - 10, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 6 / 16, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 6 / 16 + 10, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 7 / 16, myHeight * 4 / 12, 4, 15, WHITE);
}
void bar2() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  int senpak;
  // bar 2 override takes reading from slider pot and draws the bar
  tft.setCursor(20, myHeight * 5 / 12 + 5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Sending Packets");
  senpak = map(analogRead(A1), 0, 1023, 10, 295);
  tft.fillRect(senpak, myHeight * 6 / 12, 5, 15, WHITE);
  // redraws left of the slider
  tft.fillRect(9, myHeight * 6 / 12, senpak - 1, 15, TEAL);
  // redraws right of the slider
  tft.fillRect(senpak + 12, myHeight * 6 / 12, myWidth - senpak - 30, 15, TEAL);
  // draws lines
  tft.drawRect(9, myHeight * 6 / 12, myWidth - 30, 15, WHITE);
  tft.drawRect(myWidth * 3 / 16 - 10, myHeight * 6 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 3 / 16 + 10, myHeight * 6 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 3 / 16, myHeight * 6 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 4 / 16 - 10, myHeight * 6 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 4 / 16, myHeight * 6 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 4 / 16 + 10, myHeight * 6 / 12, 4, 15, WHITE);
}
void bar3() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  int ovrpak;
  //bar 3
  tft.setCursor(20, myHeight * 7 / 12 + 5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Overriding Protocol");
  ovrpak = map(analogRead(A1), 0, 1023, 10, 295);
  tft.fillRect(ovrpak, myHeight * 8 / 12, 5, 15, WHITE);
  // redraws left of the slider
  tft.fillRect(9, myHeight * 8 / 12, ovrpak - 1, 15, TEAL);
  // redraws right of the slider
  tft.fillRect(ovrpak + 12, myHeight * 8 / 12, myWidth - ovrpak - 30, 15, TEAL);
  // draws lines
  tft.drawRect(9, myHeight * 8 / 12, myWidth - 30, 15, WHITE);
  tft.drawRect(myWidth * 11 / 16 - 10, myHeight * 8 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 11 / 16 + 10, myHeight * 8 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 11 / 16, myHeight * 8 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 12 / 16 - 10, myHeight * 8 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 12 / 16, myHeight * 8 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 12 / 16 + 10, myHeight * 8 / 12, 4, 15, WHITE);
}
void calibrate2() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  // calibration testing
  tft.setCursor(myWidth * 4 / 16, myHeight * 10 / 12 - 10);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.println(analogRead(A1));
  // declarations for buttons
  debouncer1.update();
  debouncer2.update();
  int value1 = debouncer1.read();
  int value2 = debouncer2.read();
  // draws button 2 status
  tft.setCursor(myWidth * 6 / 16, myHeight * 10 / 12 - 10);
  tft.setTextColor(RED);
  tft.setTextSize(1);
  tft.println(value2);
  // draws button 1 status
  tft.setCursor(myWidth * 8 / 16, myHeight * 10 / 12 - 10);
  tft.setTextColor(OLIVE);
  tft.setTextSize(1);
  tft.println(value1);
  delay(10);
  tft.fillRect(myWidth * 4 / 16, myHeight * 10 / 12 - 10, 100, 20, TEAL);
  // end calibration testing section
}

void passedbar1() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  // renders static bar once bar 1 passed checks
  tft.setCursor(20, myHeight * 3 / 12 + 5);
  tft.drawRect(20, myHeight * 3 / 12 + 5, 200, 15, TEAL);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Established Connection");
  tft.drawRect(9, myHeight * 4 / 12, myWidth - 30, 15, WHITE);
  tft.fillRect(myWidth - 50, myHeight * 4 / 12, 30, 15, WHITE);
  tft.drawLine(myWidth - 50, myHeight * 4 / 12, myWidth - 35, myHeight * 5 / 12 - 10, GREEN);
  tft.drawLine(myWidth - 49, myHeight * 4 / 12, myWidth - 34, myHeight * 5 / 12 - 10, GREEN);
  tft.drawLine(myWidth - 48, myHeight * 4 / 12, myWidth - 33, myHeight * 5 / 12 - 10, GREEN);
  tft.drawLine(myWidth - 47, myHeight * 4 / 12, myWidth - 32, myHeight * 5 / 12 - 10, GREEN);
  tft.drawLine(myWidth - 35, myHeight * 5 / 12 - 10, myWidth * 15 / 16 + 10, myHeight * 3 / 12, GREEN);
  tft.drawLine(myWidth - 34, myHeight * 5 / 12 - 10, myWidth * 15 / 16 + 9, myHeight * 3 / 12, GREEN);
  tft.drawLine(myWidth - 33, myHeight * 5 / 12 - 10, myWidth * 15 / 16 + 8, myHeight * 3 / 12, GREEN);
  tft.drawLine(myWidth - 32, myHeight * 5 / 12 - 10, myWidth * 15 / 16 + 7, myHeight * 3 / 12, GREEN);
  tft.drawRect(myWidth * 4 / 16 - 10, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 4 / 16 + 10, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 4 / 16, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 5 / 16 - 10, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 5 / 16, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 5 / 16 + 10, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 6 / 16 - 10, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 6 / 16, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 6 / 16 + 10, myHeight * 4 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 7 / 16, myHeight * 4 / 12, 4, 15, WHITE);
}
void passedbar2() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  int senpak;
  // bar 2 override takes reading from slider pot and draws the bar
  tft.setCursor(20, myHeight * 5 / 12 + 5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Packet Sent");
  // draws lines
  tft.drawRect(9, myHeight * 6 / 12, myWidth - 30, 15, WHITE);
  tft.drawRect(myWidth * 3 / 16 - 10, myHeight * 6 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 3 / 16 + 10, myHeight * 6 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 3 / 16, myHeight * 6 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 4 / 16 - 10, myHeight * 6 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 4 / 16, myHeight * 6 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 4 / 16 + 10, myHeight * 6 / 12, 4, 15, WHITE);
  tft.fillRect(myWidth - 50, myHeight * 6 / 12, 30, 15, WHITE);
  tft.drawLine(myWidth - 50, myHeight * 6 / 12, myWidth - 35, myHeight * 7 / 12 - 10, GREEN);
  tft.drawLine(myWidth - 49, myHeight * 6 / 12, myWidth - 34, myHeight * 7 / 12 - 10, GREEN);
  tft.drawLine(myWidth - 48, myHeight * 6 / 12, myWidth - 33, myHeight * 7 / 12 - 10, GREEN);
  tft.drawLine(myWidth - 47, myHeight * 6 / 12, myWidth - 32, myHeight * 7 / 12 - 10, GREEN);
  tft.drawLine(myWidth - 35, myHeight * 7 / 12 - 10, myWidth * 15 / 16 + 10, myHeight * 5 / 12, GREEN);
  tft.drawLine(myWidth - 34, myHeight * 7 / 12 - 10, myWidth * 15 / 16 + 9, myHeight * 5 / 12, GREEN);
  tft.drawLine(myWidth - 33, myHeight * 7 / 12 - 10, myWidth * 15 / 16 + 8, myHeight * 5 / 12, GREEN);
  tft.drawLine(myWidth - 32, myHeight * 7 / 12 - 10, myWidth * 15 / 16 + 7, myHeight * 5 / 12, GREEN); 

}
void passedbar3() {
int myHeight = tft.height();
  int myWidth = tft.width();
  int ovrpak;
  //bar 3
  tft.setCursor(20, myHeight * 7 / 12 + 5);
  tft.setTextColor(WHITE);
  tft.setTextSize(1);
  tft.print("Protocol Bypassed");

  // draws lines
  tft.drawRect(9, myHeight * 8 / 12, myWidth - 30, 15, WHITE);
  tft.drawRect(myWidth * 11 / 16 - 10, myHeight * 8 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 11 / 16 + 10, myHeight * 8 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 11 / 16, myHeight * 8 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 12 / 16 - 10, myHeight * 8 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 12 / 16, myHeight * 8 / 12, 4, 15, WHITE);
  tft.drawRect(myWidth * 12 / 16 + 10, myHeight * 8 / 12, 4, 15, WHITE);
 
  tft.fillRect(myWidth - 50, myHeight * 8 / 12, 30, 15, WHITE);
  tft.drawLine(myWidth - 50, myHeight * 8 / 12, myWidth - 35, myHeight * 9 / 12 - 10, GREEN);
  tft.drawLine(myWidth - 49, myHeight * 8 / 12, myWidth - 34, myHeight * 9 / 12 - 10, GREEN);
  tft.drawLine(myWidth - 48, myHeight * 8 / 12, myWidth - 33, myHeight * 9 / 12 - 10, GREEN);
  tft.drawLine(myWidth - 47, myHeight * 8 / 12, myWidth - 32, myHeight * 9 / 12 - 10, GREEN);
  tft.drawLine(myWidth - 35, myHeight * 9 / 12 - 10, myWidth * 15 / 16 + 10, myHeight * 7 / 12, GREEN);
  tft.drawLine(myWidth - 34, myHeight * 9 / 12 - 10, myWidth * 15 / 16 + 9, myHeight * 7 / 12, GREEN);
  tft.drawLine(myWidth - 33, myHeight * 9 / 12 - 10, myWidth * 15 / 16 + 8, myHeight * 7 / 12, GREEN);
  tft.drawLine(myWidth - 32, myHeight * 9 / 12 - 10, myWidth * 15 / 16 + 7, myHeight * 7 / 12, GREEN); 
 
}
void accessgranted() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  tft.fillScreen(GREEN);
  // center box
  // yellow border
  tft.drawRect(myWidth * 2 / 16 - 8, myHeight * 4 / 12, myWidth * 13 / 16 + 12, myHeight * 4 / 12, YELLOW);
  tft.drawRect(myWidth * 2 / 16 - 7, myHeight * 4 / 12 - 1, myWidth * 13 / 16 + 12, myHeight * 4 / 12, YELLOW);
  tft.drawRect(myWidth * 2 / 16 - 6, myHeight * 4 / 12 - 2, myWidth * 13 / 16 + 12, myHeight * 4 / 12, YELLOW);
  tft.drawRect(myWidth * 2 / 16 - 5, myHeight * 4 / 12 - 3, myWidth * 13 / 16 + 12, myHeight * 4 / 12, YELLOW);
  tft.drawRect(myWidth * 2 / 16 - 4, myHeight * 4 / 12 - 4, myWidth * 13 / 16 + 12, myHeight * 4 / 12, YELLOW);
  tft.drawRect(myWidth * 2 / 16 - 3, myHeight * 4 / 12 - 5, myWidth * 13 / 16 + 12, myHeight * 4 / 12, YELLOW);
  // this fills the center box black
  tft.fillRect(myWidth * 2 / 16 - 2, myHeight * 4 / 12 - 0, myWidth * 13 / 16 + 5, myHeight * 4 / 12 - 5 ,BLACK);
  // text segments
  tft.setCursor(myWidth * 2 / 16, myHeight * 5 / 12 - 10);
  tft.setTextColor(GREEN);
  tft.setTextSize(2);
  tft.print("Code Accepted");
  tft.setCursor(myWidth * 2 / 16, myHeight * 7 / 12 - 10);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("SYSTEM DETECTIONS");
  tft.setCursor(myWidth * 13 / 16, myHeight * 7 / 12 - 10);
  tft.setTextColor(GREEN);
  tft.setTextSize(2);
  tft.print(detect);
  tft.setCursor(myWidth * 13 / 16 + 12, myHeight * 7 / 12 - 10);
  tft.setTextColor(GREEN);
  tft.setTextSize(2);
  tft.print("/3");
 
}
void gamelost1() {}
void gamewon1() {
  int myHeight = tft.height();
  int myWidth = tft.width();
  tft.fillScreen(GREENYELLOW);
  // text segments
  tft.setCursor(myWidth * 4 / 16, myHeight * 6 / 12 - 10);
  tft.setTextColor(TEAL);
  tft.setTextSize(2);
  tft.print("Acces Granted");
 
}

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Mar 27, 2023 9:19 pm 
User avatar

Location: Wellywood.
Service Number: A10/TQ0.0.82146E1
Country: New Zealand
Those screens are looking cool! 8) 8) 8)

_________________
Cpl Aron "septic" Williams
A10/TQ0.0.82146E1


Top
 Profile  
Reply with quote  
 Post subject: Re:
PostPosted: Wed Mar 29, 2023 11:04 pm 

Service Number: A05/TQ2.0.32141E1
Country: United States
septic wrote:
Those screens are looking cool! 8) 8) 8)


I am trying to strive for extreme game screen accuracy.

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 02, 2023 2:30 am 

Service Number: A05/TQ2.0.32141E1
Country: United States
Got all the logic pieces sorted I think. I just need to add in some display pieces such as the second boot screen bars and game1's static fascimile.

I have the game won pieces done, the game lost piece done.

Getting the reset function to work was interesting.

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 56 posts ]  Go to page Previous  1, 2, 3  Next



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron