OK, more progress. I got the basic geometry piece done other than coding 6 lines for triangles. I am again approaching the program limits for the arduino.
Code:
/***************************************************
This is our GFX example for the Adafruit ILI9341 Breakout and Shield
----> http://www.adafruit.com/products/1651
Check out the links above for our tutorials and wiring diagrams
These displays use SPI to communicate, 4 or 5 pins are required to
interface (RST is optional)
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
MIT license, all text above must be included in any redistribution
****************************************************/
// Code provided by Smoke And Wires
// http://www.smokeandwires.co.nz
// IMPORTANT: Adafruit_TFTLCD LIBRARY MUST BE SPECIFICALLY
// CONFIGURED FOR EITHER THE TFT SHIELD OR THE BREAKOUT BOARD.
// SEE RELEVANT COMMENTS IN Adafruit_TFTLCD.h FOR SETUP.
#include "SPI.h"
#include <Wire.h>
#include "Adafruit_GFX.h" // for display
#include "Adafruit_ILI9341.h" //for display
#include <Adafruit_TFTLCD.h> // Hardware-specific library for display
#include <Adafruit_NeoKey_1x4.h> //for 4button board
#include <seesaw_neopixel.h> // for 4 button board
#include <Adafruit_LEDBackpack.h> //for 24 led bars
#include <avr/wdt.h>
// these are for ili9341 chips
// For the Adafruit shield, these are the default.
//#define TFT_DC 9
//#define TFT_CS 10
//#define TFT_MOSI 11
//#define TFT_CLK 13
//#define TFT_RST 12
//#define TFT_MISO 8
//#define TFT_CS 10
// The control pins for the LCD can be assigned to any digital or
// analog pins...but we'll use the analog pins as this allows us to
// double up the pins with the touch screen (see the TFT paint example).
#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0
#define LCD_RESET PC6 // Can alternately just connect to Arduino's reset pin(PC6 on nano, RESET on Micro) this is not used.
// When using the BREAKOUT BOARD only, use these 8 data lines to the LCD:
// For the Arduino Uno, Duemilanove, Diecimila, etc.:
// D0 connects to digital pin 8 (Notice these are
// D1 connects to digital pin 9 NOT in order!)
// D2 connects to digital pin 2
// D3 connects to digital pin 3
// D4 connects to digital pin 4
// D5 connects to digital pin 5
// D6 connects to digital pin 6
// D7 connects to digital pin 7
// For the Arduino Mega, use digital pins 22 through 29
// (on the 2-row header at the end of the board).
// 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
// defines pins numbers
const int trigPin = A6;
const int echoPin = A7;
const int pirPin = 13;
const int pirPinL = 12;
const int pirPinR = 10;
const int Spin = 11;
// defines variables
long duration;
int distance;
// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
// for nano hardwre spi is miso=12, mosi=11, sck=13,
//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
// If using the breakout, change pins as desired
//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
// below is the invocation for the 3.5" lcd
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
// the led bar setup
Adafruit_24bargraph bar1 = Adafruit_24bargraph();
Adafruit_24bargraph bar2 = Adafruit_24bargraph();
// neokey initializer
Adafruit_NeoKey_1x4 neokey;
void setup() {
pinMode(pirPin, INPUT); //Input from the PIR sensors
pinMode(pirPinL, INPUT);
pinMode(pirPinR, INPUT);
pinMode(trigPin, OUTPUT); // Output for the triggerpins
pinMode(Spin, OUTPUT); // pin for the piezo buzzer
pinMode(echoPin, INPUT); // Input from the Ultrasound sensors
Serial.begin(9600);
//below line is for the ili9341 display
// uint16_t identifier = tft.read16();
// this is for the 3.5" screen ID
uint16_t identifier = tft.readID();
tft.begin(identifier);
tft.setRotation(0);
txt();
tft.setRotation(0);
tft.fillScreen(BLACK);
// the led bar initializers
bar1.begin(0x70); // pass in the address
bar2.begin(0x71);
bar1.setBar(0, LED_RED);
bar1.setBar(2, LED_RED);
bar1.setBar(4, LED_RED);
bar1.setBar(6, LED_RED);
bar1.setBar(8, LED_RED);
bar1.setBar(10, LED_RED);
bar1.setBar(12, LED_RED);
bar1.setBar(14, LED_RED);
bar1.setBar(16, LED_RED);
bar1.setBar(18, LED_RED);
bar1.setBar(20, LED_RED);
bar1.setBar(22, LED_RED);
bar1.writeDisplay();
bar2.setBar(0, LED_RED);
bar2.setBar(2, LED_RED);
bar2.setBar(4, LED_RED);
bar2.setBar(6, LED_RED);
bar2.setBar(8, LED_RED);
bar2.setBar(10, LED_RED);
bar2.setBar(12, LED_RED);
bar2.setBar(14, LED_RED);
bar2.setBar(16, LED_RED);
bar2.setBar(18, LED_RED);
bar2.setBar(20, LED_RED);
bar2.setBar(22, LED_RED);
bar2.writeDisplay();
//neokey initializier
neokey.begin(0x30);
}
void loop(void) {
// neo pixel
uint8_t buttons = neokey.read();
if (buttons & (1<<0)) { Serial.println("Button A"); neokey.pixels.setPixelColor(0,255,0,0); tft.fillScreen(BLACK);}
else { neokey.pixels.setPixelColor(0, 0);}
if (buttons & (1<<1)) { Serial.println("Button B"); neokey.pixels.setPixelColor(1,0x808080); delay(15000); softwareReset(WDTO_60MS);}
else { neokey.pixels.setPixelColor(1, 0);}
if (buttons & (1<<2)) { Serial.println("Button C"); neokey.pixels.setPixelColor(2,0,255,0); }
else { neokey.pixels.setPixelColor(2, 0); }
if (buttons & (1<<3)) { Serial.println("Button D"); neokey.pixels.setPixelColor(3,0,0,255); p_s();}
else { neokey.pixels.setPixelColor(3, 0); }
neokey.pixels.show();
// end neopixel initializer
table(); // render bars
// check if motion detected
int myHeight = tft.height(); int myWidth = tft.width();
// ping(us(), myHeight*1/2);
if (digitalRead(pirPin) == HIGH) { ping(us(), myHeight * 1 / 2); table(); p_s(); digitalWrite(pirPin, LOW); }
if (digitalRead(pirPinL) == HIGH) { sideL(); table(); p_s(); digitalWrite(pirPinL, LOW);}
if (digitalRead(pirPinR) == HIGH) { sideR(); table(); p_s(); digitalWrite(pirPinR, LOW); }
}
void table() //create the monitor
{
int myHeight = tft.height(); int myWidth = tft.width();
tft.setCursor(myWidth * 1 /16, 5);
tft.setTextColor(RED);
tft.setTextSize(2);
tft.println("-CN");
tft.setCursor(myWidth * 1 /16, myHeight*23/24);
tft.setTextColor(RED);
tft.setTextSize(2);
tft.println("7-772");
tft.setCursor(myWidth * 11 /16-10, myHeight*23/24);
tft.setTextColor(RED);
tft.setTextSize(2);
tft.println("47-CLN");
// draws main grid lines for tracker grid
tft.drawLine(myWidth *2/16, myHeight * 3/24, myWidth *8/16, myHeight * 14 / 24, GREEN);
tft.drawLine(myWidth *8/16, myHeight * 14 / 24, myWidth * 14 / 16, myHeight * 3 /24, GREEN);
tft.drawLine(myWidth *8/16, myHeight * 14 / 24, myWidth * 4 / 16+10, myHeight * 1 /24, GREEN);
tft.drawLine(myWidth *8/16, myHeight * 14 / 24, myWidth * 11 / 16+10, myHeight * 1 /24, GREEN);
tft.drawLine(myWidth *8/16, myHeight * 14 / 24, myWidth * 8 / 16, myHeight * 1 /24-5, GREEN);
// black line left most
tft.drawLine(myWidth*7/16+11,myHeight*13/24, myWidth*4/16,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+12,myHeight*13/24, myWidth*4/16+1,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+13,myHeight*13/24, myWidth*4/16+2,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+10,myHeight*13/24, myWidth*4/16+5,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+10,myHeight*13/24, myWidth*4/16+6,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+10,myHeight*13/24, myWidth*4/16+7,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+10,myHeight*13/24, myWidth*4/16+8,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+10,myHeight*13/24, myWidth*4/16+4,myHeight*3/24,BLACK);
//left inside
tft.drawLine(myWidth*7/16+15,myHeight*12/24, myWidth*6/16-5,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+14,myHeight*12/24, myWidth*6/16-4,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+13,myHeight*12/24, myWidth*6/16-6,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+15,myHeight*12/24, myWidth*6/16-3,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+15,myHeight*12/24, myWidth*6/16-2,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+15,myHeight*12/24, myWidth*6/16-1,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+15,myHeight*12/24, myWidth*6/16,myHeight*3/24, BLACK);
tft.drawLine(myWidth*7/16+15,myHeight*12/24, myWidth*6/16+1,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+16,myHeight*12/24, myWidth*7/16+11,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+15,myHeight*12/24, myWidth*7/16+12,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+15,myHeight*12/24, myWidth*7/16+13,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+15,myHeight*12/24, myWidth*7/16+10,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+15,myHeight*12/24, myWidth*7/16+10,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+15,myHeight*12/24, myWidth*7/16+9,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+15,myHeight*12/24, myWidth*7/16+8,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+15,myHeight*12/24, myWidth*7/16+7,myHeight*3/24,BLACK);
tft.drawLine(myWidth*7/16+15,myHeight*12/24, myWidth*7/16+6,myHeight*3/24,BLACK);
// right inside
tft.drawLine(myWidth*8/16+2,myHeight*12/24, myWidth*10/16+7,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+3,myHeight*12/24, myWidth*10/16+8,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+4,myHeight*12/24, myWidth*10/16+9,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+4,myHeight*12/24, myWidth*10/16+10,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+4,myHeight*12/24, myWidth*10/16+11,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+4,myHeight*12/24, myWidth*10/16+4,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+4,myHeight*12/24, myWidth*10/16+5,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+4,myHeight*12/24, myWidth*10/16+6,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+4,myHeight*12/24, myWidth*9/16-4,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+4,myHeight*12/24, myWidth*9/16-3,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+4,myHeight*12/24, myWidth*9/16-2,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+4,myHeight*12/24, myWidth*9/16-1,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+4,myHeight*12/24, myWidth*9/16,myHeight*3/24, BLACK);
tft.drawLine(myWidth*8/16+4,myHeight*12/24, myWidth*9/16+1,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+4,myHeight*12/24, myWidth*9/16+2,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+4,myHeight*12/24, myWidth*9/16+3,myHeight*3/24,BLACK);
//right most
tft.drawLine(myWidth*8/16+12,myHeight*12/24, myWidth*13/16-5,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+13,myHeight*12/24, myWidth*13/16-4,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+14,myHeight*12/24, myWidth*13/16-3,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+15,myHeight*12/24, myWidth*13/16-2,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+16,myHeight*12/24, myWidth*13/16-1,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+15,myHeight*12/24, myWidth*13/16,myHeight*3/24, BLACK);
tft.drawLine(myWidth*8/16+15,myHeight*12/24, myWidth*13/16+1,myHeight*3/24,BLACK);
tft.drawLine(myWidth*8/16+15,myHeight*12/24, myWidth*13/16+2,myHeight*3/24,BLACK);
// draws square on top
tft.fillRect(myWidth*8/16-4, myWidth*1/24,9,9,GREEN);
// circle geomotry for scanner fields
// tft.drawCircle(myWidth *8/16, myHeight * 13 / 24, myWidth * 1 / 8, GREEN);
tft.drawCircle(myWidth *8/16, myHeight * 13 / 24, myWidth * 3 / 16+15, GREEN);
tft.drawCircle(myWidth*8/16, myHeight * 1 / 2, myWidth * 1 / 4+20, GREEN);
tft.drawCircle(myWidth*8/16, myHeight * 1 / 2, myWidth * 7 / 16, GREEN);
tft.drawCircle(myWidth*8/16, myHeight * 1 / 2, myWidth * 5 / 8 +16, GREEN);
// clears circle geomotry out of field
// tft.fillTriangle(0,5,0,myHeight -24, myWidth-65,myHeight-24, BLACK);
tft.fillTriangle(0,5,0,myHeight -24, myWidth *8/16, myHeight * 14 / 24, BLACK);
tft.fillTriangle(myWidth,5,myWidth,myHeight-24,myWidth *8/16, myHeight * 14 / 24,BLACK);
tft.fillTriangle(myWidth *8/16, myHeight * 14 / 24,0,myHeight-24,myWidth,myHeight-24,BLACK);
// yellow calibration lines
tft.drawTriangle(0,5,0,myHeight -24, myWidth *8/16, myHeight * 14 / 24, YELLOW);
tft.drawTriangle(myWidth,5,myWidth,myHeight-24,myWidth *8/16, myHeight * 14 / 24,YELLOW);
tft.drawTriangle(myWidth *8/16, myHeight * 14 / 24,0,myHeight-24,myWidth,myHeight-24,YELLOW);
// tracker blip geomoetry
tft.fillCircle(myWidth*8/16,myHeight*14/24, myWidth*4/16, GREEN);
tft.fillCircle(myWidth*8/16,myHeight*14/24, myWidth*2/16, BLACK);
tft.fillTriangle(myWidth*8/16,myHeight*14/24,myWidth*3/16,myHeight*19/24+10,myWidth*3/16,myHeight*16/24,BLACK);
tft.fillTriangle(myWidth*8/16,myHeight*14/24,myWidth*13/16,myHeight*19/24+10,myWidth*13/16,myHeight*16/24,BLACK);
tft.drawCircle(myWidth*8/16,myHeight*14/24, myWidth*4/16+1, RED);
tft.drawCircle(myWidth*8/16,myHeight*14/24, myWidth*4/16, RED);
tft.drawCircle(myWidth*8/16,myHeight*14/24, myWidth*4/16-1, RED);
tft.drawCircle(myWidth*8/16,myHeight*14/24, myWidth*4/16-2, RED);
tft.drawCircle(myWidth*8/16,myHeight*14/24, myWidth*4/16-3, RED);
tft.drawCircle(myWidth*8/16,myHeight*14/24, myWidth*4/16-4, RED);
tft.drawCircle(myWidth*8/16,myHeight*14/24, myWidth*2/16, RED);
tft.drawCircle(myWidth*8/16,myHeight*14/24, myWidth*2/16+1, RED);
tft.drawCircle(myWidth*8/16,myHeight*14/24, myWidth*2/16+2, RED);
tft.drawCircle(myWidth*8/16,myHeight*14/24, myWidth*2/16+3, RED);
tft.drawCircle(myWidth*8/16,myHeight*14/24, myWidth*2/16+4, RED);
// calibration triangles for geometry
tft.drawTriangle(myWidth*8/16,myHeight*14/24,myWidth*3/16,myHeight*19/24+10,myWidth*3/16,myHeight*16/24,YELLOW);
tft.drawTriangle(myWidth*8/16,myHeight*14/24,myWidth*13/16,myHeight*19/24+10,myWidth*13/16,myHeight*16/24,YELLOW);
// right bottom
tft.drawLine(myWidth*10/16-1,myHeight*15/24-5,myWidth*12/16-6,myHeight*16/24-12,RED);
tft.drawLine(myWidth*10/16-1,myHeight*15/24-4,myWidth*12/16-6,myHeight*16/24-11,RED);
tft.drawLine(myWidth*10/16-1,myHeight*15/24-3,myWidth*12/16-6,myHeight*16/24-10,RED);
// right top
// tft.drawLine(myWidth*9/16+5,myHeight*13/24-12,myWidth*11/16-11,myHeight*11/24-5,RED);
// tft.drawLine(myWidth*9/16+5,myHeight*13/24-7,myWidth*11/16-11,myHeight*11/24,RED);
tft.fillTriangle(myWidth*9/16+5,myHeight*13/24-12,myWidth*9/16+5,myHeight*13/24-7,myWidth*11/16-11,myHeight*11/24-5,RED);
tft.fillTriangle(myWidth*9/16+5,myHeight*13/24-7,myWidth*11/16-11,myHeight*11/24,myWidth*11/16-11,myHeight*11/24-5,RED);
// myWidth*11/16-11,myHeight*11/24,BLUE);
// bottom right
// tft.drawLine(myWidth*9/16+8,myHeight*16/24-10,myWidth*11/16-7,myHeight*17/24-2,RED);
// tft.drawLine(myWidth*9/16+4,myHeight*16/24-8,myWidth*11/16-10,myHeight*17/24+2,RED);
tft.fillTriangle(myWidth*9/16+8,myHeight*16/24-10,myWidth*9/16+4,myHeight*16/24-8,myWidth*11/16-7,myHeight*17/24-2,RED);
tft.fillTriangle(myWidth*11/16-7,myHeight*17/24-2, myWidth*11/16-10,myHeight*17/24+2, myWidth*9/16+4,myHeight*16/24-8, RED);
// left top
tft.drawLine(myWidth*7/16-6,myHeight*13/24-14,myWidth*5/16+11,myHeight*11/24-4,RED);
tft.drawLine(myWidth*7/16-8,myHeight*13/24-8,myWidth*5/16+6,myHeight*11/24-1,RED);
//left bottomt
tft.drawLine(myWidth*6/16+3,myHeight*15/24-4,myWidth*4/16+5,myHeight*15/24+10,RED);
tft.drawLine(myWidth*6/16+2,myHeight*15/24-8,myWidth*4/16+4,myHeight*15/24+6,RED);
//bottom left
tft.drawLine(myWidth*7/16-8,myHeight*16/24-10,myWidth*5/16+7,myHeight*17/24-1,RED);
tft.drawLine(myWidth*7/16-4,myHeight*16/24-8,myWidth*5/16+11,myHeight*17/24+2,RED);
// clears circle geometry inside tracker field
tft.fillTriangle(myWidth*8/16,myHeight*14/24,myWidth*5/16,myHeight*10/24,myWidth*11/16,myHeight*10/24,BLACK);
// tft.drawCircle(myWidth*8/16, myHeight * 1 / 2, myWidth * 7 / 8, GREEN);
//l circle
// tft.fillTriangle(myWidth*8/16, myHeight * 1 / 2 - 5, myWidth, myHeight * 5 / 8, myWidth * 13 / 16 - 25, myHeight * 5 / 8, GREEN);
// r circle
//tft.fillTriangle(myWidth*8/16, myHeight * 1 / 2 + 5, myWidth, myHeight * 3 / 8, myWidth * 13 / 16 - 25, myHeight * 3 / 8, GREEN);
//this covers the circle artifacts for the tracker grid
// tft.fillTriangle(0,5,0,myHeight -24, myWidth-65,myHeight-24, BLACK);
//tft.fillTriangle(myWidth,5,myWidth,myHeight-24,65,myHeight-24,BLACK);
}
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 < 16; i++) {
tft.print(".");
delay(200);
}
}
void ping(int dis, int x) { //Display the motion
tft.fillCircle((((320 * 8/16)+dis)),(480*2/24 -x), 10, GREEN);
// Serial.println(x);
delay(100);
tft.fillCircle((((320 * 8/16)+dis)),(480*2/24 -x), 10, BLACK);
}
int us() //ultrasound distance device control
{
digitalWrite(trigPin, LOW); delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH); // Reads the echoPins, returns the sound wave travel time in microseconds
distance = duration * 0.034 / 2; // Calculating the distance
return (240 - (distance * 0.7)); //This needed for the proper displaying
}
//right PIR sensor event
void sideR() { int myHeight = tft.height(); int myWidth = tft.width();
tft.fillTriangle(myWidth, myHeight * 1 / 2 + 5, myWidth, myHeight * 3 / 8, myWidth * 13 / 16 - 25, myHeight * 3 / 8, GREEN);
delay(100);
tft.fillTriangle(myWidth, myHeight * 1 / 2 + 5, myWidth, myHeight * 3 / 8, myWidth * 13 / 16 - 25, myHeight * 3 / 8, BLACK);
}
//left PIR sensor event
void sideL() { int myHeight = tft.height(); int myWidth = tft.width();
tft.fillTriangle(myWidth, myHeight * 1 / 2 - 5, myWidth, myHeight * 5 / 8, myWidth * 13 / 16 - 25, myHeight * 5 / 8, GREEN);
delay(100);
tft.fillTriangle(myWidth, myHeight * 1 / 2 - 5, myWidth, myHeight * 5 / 8, myWidth * 13 / 16 - 25, myHeight * 5 / 8, BLACK);
}
void p_s() { digitalWrite(Spin, HIGH); delay(100); digitalWrite(Spin, LOW);} //Tracking sound effect
void softwareReset(uint8_t prescaller) {
wdt_enable(prescaller);
while (1) {}
}