no it still doesn’t work. I have nothing left to try
thank you for responding but still need help.
my current sketch is here
code:
#include <stdint.h>
#include <TouchScreen.h>
#include <TFT.h>
#include <cstddef.h>
#include <SPI.h>
#define YP A2 // must be an analog pin, use “An” notation!
#define XM A1 // must be an analog pin, use “An” notation!
#define YM A0 // can be a digital pin, this is A0
#define XP A3 // can be a digital pin, this is A3
#define CS 7 // tft select pin for SPI
#define MOSI 51
#define MISO 50
#define SCK 52
#define TS_MINX 140
#define TS_MAXX 900
#define TS_MINY 120
#define TS_MAXY 940
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); //init TouchScreen port pins
int rD=0,finger=0;
const int TxPin = 14;// seting up mySerial com to LCD display
#include <SoftwareSerial.h>
SoftwareSerial mySerial = SoftwareSerial(255, TxPin);
void setup(){out(TxPin);digitalWrite(TxPin, HIGH);
out(SCK);out(CS);out(MOSI);in(MISO);dH(MOSI);dH(SCK);dH(CS);
mySerial.begin(9600);delay(100);openDisplay();}
void loop(){buttons(); // Print Char to TFT //
Tft.fillRectangle(200,60,50,15,BLACK); // Clear old text
Tft.fillRectangle(200,120,60,15,BLACK); // Clear old text
Tft.fillRectangle(200,150,60,15,BLACK); // Clear old text
Tft.fillRectangle(200,180,60,15,BLACK); // Clear old text
delay(1000);} // delay to read screen
void drawScreen(){
Tft.drawRectangle(0, 3, 238,30,BLUE); // HEADER TITLE
Tft.drawString(“Display Data”,20,15,2,WHITE); // header name
Tft.drawString(“Hi”,140,40,1,WHITE);
Tft.drawString(“Low”,155,40,1,WHITE);
Tft.drawString(“Current”,180,40,1,WHITE);
Tft.drawString(“Seconds:”,2,60,2,CYAN);
Tft.drawString(“Temp”,2,90,2,WHITE);
Tft.drawString(“Internal:”,20,120,1,WHITE);
Tft.drawString(“External:”,20,150,1,WHITE);
Tft.drawString(“pH:”,2,170,2,WHITE);
Tft.drawRectangle(0, 196, 70, 30,BLUE);
Tft.drawString(“Pump 1”, 15, 208, 1, WHITE);
Tft.drawRectangle(80, 196, 70, 30, BLUE);
Tft.drawString(“Pump 2”, 95 , 208 , 1, WHITE);
Tft.drawRectangle(160, 196, 70, 30, BLUE);
Tft.drawString(“Fans”, 175, 208, 1, WHITE);
Tft.drawRectangle(0, 236, 110,30,BLUE);
Tft.drawString(“Return Pump”, 15, 248,1,WHITE);
Tft.drawRectangle(120, 236, 110, 30, BLUE);
Tft.drawString(“Skimmer”, 150, 248, 1, WHITE);
Tft.drawRectangle(0, 276, 110, 30, BLUE);
Tft.drawString(“Halides”, 25, 286, 1, WHITE);
Tft.drawRectangle(120, 276, 110, 30, BLUE);
Tft.drawString(“Actnitcs”, 140, 286, 1, WHITE); }
void buttons(){
Point p = ts.getPoint();
p.x = map(p.x, TS_MINX, TS_MAXX, 240, 0);
p.y = map(p.y, TS_MINY, TS_MAXY, 320, 0);
clr();mySerial.print(“X”);sp();
mySerial.print(p.x);lF();
mySerial.print(“Y”);sp();
mySerial.print(p.y);sp();
delay(1000);
}
///////////////////////////////////////////////////////////////////////////For Pump 1
// my standard functions+
int in(int pin){pinMode(pin,INPUT);}
int out(int pin){pinMode(pin,OUTPUT);}
int dR(int pin){rD=digitalRead(pin);return rD;}
int dW(int pin, int logic){if(logic==1){digitalWrite(pin,HIGH);}else{digitalWrite(pin,LOW);}}
int pU(int pin){pinMode(pin,INPUT_PULLUP);}
int dH(int pin){digitalWrite(pin,HIGH);}
int dL(int pin){digitalWrite(pin,LOW);}
int aW(int pin,int duty){analogWrite(pin,duty);}
int aR(int pin){rD=analogRead(pin);return rD;}
void iPU( int pin){pinMode(pin,INPUT_PULLUP);}
//LCD CONTROL
void cursorL(int spaces){for(int a=0;a<spaces;a++){mySerial.write(8);}}
void cursorR(int spaces){for(int a=0;a<spaces;a++){mySerial.write(9);}}
void cursorD(){mySerial.write(10);}
void cursorNotBlinkNot(){mySerial.write(22);}
void cursorNotBlink(){mySerial.write(23);}
void cursorBlinkNot(){mySerial.write(24);}
void cursorBlink(){mySerial.write(25);}
void cursorLine1(){mySerial.write(128);}
void cursorLine2(){mySerial.write(148);}
int curs(int line,int spaces){
if(line==1){mySerial.write(128);}else{mySerial.write(148);}
while(spaces>0){spaces–;mySerial.write(9);}}
int p(int prn){mySerial.print(prn);}//print an integer
void sp(){mySerial.print(" ");}
void clr(){mySerial.write(12);delay(50);}//only clear
void snd1(){mySerial.write(212);mySerial.write(220);} // sou8nd a tone FROM THE DISPLAY
void openDisplay(){mySerial.write(12);mySerial.write(17);delay(5);}//Clear display steer backlight on and add Required delay
void closeDisplay(){mySerial.write(18);}//steer light off
void clearDisplay(){mySerial.write(12);}//only clear
void lineF(){mySerial.write(13);}// line feed
void onDisplay(){mySerial.write(17);delay(5);}
void offDisplay(){mySerial.write(18);}//steer light off
void lF(){mySerial.write(13);}
int showHex(int hex){if(hex>=0 && hex<10){mySerial.print(hex);}
if(hex==10){mySerial.print(“A”);}
if(hex==11){mySerial.print(“B”);}
if(hex==12){mySerial.print(“C”);}
if(hex==13){mySerial.print(“D”);}
if(hex==14){mySerial.print(“E”);}
if(hex==15){mySerial.print(“F”);}}
// end my standard functions
/code:
thanks