i need help with my touchscreen and analoge read on the display

when i pushed on a button the poort wil be flashing but i need a stable open when i pushed en when not pusching closed how is that possible

here is my code

#include <UTFT.h>
#include <UTouch.h>

// Declare which fonts we will be using
extern uint8_t SmallFont;
extern uint8_t BigFont;
extern uint8_t SevenSegNumFont;
extern uint8_t SevenSeg_XXXL_Num;

int x, y,g,menu;

UTFT myGLCD(ITDB32S,38,39,40,41);
UTouch myTouch(6,5,4,3,2);

#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
int rawValue; // A/D readings
int rawValue1; // A/D readings
int offset = 95; // zero pressure adjust
int fullScale = 807; // max pressure (span) adjust
float pressure; // final pressure
float pressure1; // final pressure
#define voorkant 120
#define achterkant 120 // dit is de waarde voor de drive button om te stoppen
const int voorup = 14;
const int voordown = 15;
const int achterup = 16;
const int achterdown = 17;
//temp sensoren motor
float temp;
float temp1;
char junk;
String inputString="";
void setup()

pinMode(voorup, OUTPUT);
pinMode(voordown, OUTPUT);
pinMode(achterup, OUTPUT);
pinMode(achterdown, OUTPUT);

digitalWrite(voorup, HIGH);
digitalWrite(voordown, HIGH);
digitalWrite(achterup, HIGH);
digitalWrite(achterdown, HIGH);

myGLCD.InitLCD(LANDSCAPE); // Initialize the display
myGLCD.clrScr(); // Clear the screen (black)
myGLCD.fillScr(255,255,255); // Clear the screen (White)
delay(600); //Delay to draw the image
// vak links onder
myGLCD.drawRoundRect(5, 5, 120,120); ///links boven
myGLCD.drawRoundRect(120, 5, 240,120); ///rechts boven
myGLCD.drawRoundRect(5, 235, 120,120); ///links onder
myGLCD.drawRoundRect(120, 235, 240,120); ///rechts onder
myGLCD.drawRoundRect(240, 5, 319,65);
myGLCD.drawRoundRect(240, 65, 319,120);
myGLCD.drawRoundRect(240, 120, 319,160);
myGLCD.drawRoundRect(240, 160, 319,197);
myGLCD.drawRoundRect(240, 197, 319,235);
void loop()

rawValue = analogRead(A0);
rawValue1 = analogRead(A1);
pressure = (rawValue - offset) * 7.9 / (fullScale - offset);
pressure1 = (rawValue1 - offset) * 7.9 / (fullScale - offset);

temp = analogRead(A2);
temp = temp * 0.48828125;
temp1 = analogRead(A3);
temp1 = temp * 0.48828125;

if( analogRead(A0) >= voorkant )
digitalWrite(voorup, HIGH);
if( analogRead(A0) >= achterkant )
digitalWrite(achterup, HIGH);

if (myTouch.dataAvailable())

if ((x>40) && (x<80) && (y>20) && (y<60)) // button: DRIVE
digitalWrite(voorup, LOW);
digitalWrite(achterup, LOW);
myGLCD.print(" “,245,140);
if ((x>160) && (x<180) && (y>10) && (y<50)) // button: + ALL
digitalWrite(voorup, LOW);
digitalWrite(achterup, LOW);
myGLCD.print(“ALL +”,245,140);
myGLCD.print(” “,245,140);
digitalWrite(voorup, HIGH);
digitalWrite(achterup, HIGH);
if ((x>160) && (x<180) && (y>70) && (y<90)) // button: - ALL
digitalWrite(voordown, LOW);
digitalWrite(achterdown, LOW);
myGLCD.print(“ALL -”,245,140);
myGLCD.print(” “,245,140);
digitalWrite(voordown, HIGH);
digitalWrite(achterdown, HIGH);
if ((x>60) && (x<80) && (y>120) && (y<160)) // button: + FRONT
digitalWrite(voorup, LOW);
myGLCD.print(“FRONT +”,245,140);
myGLCD.print(” “,245,140);
digitalWrite(voorup, HIGH);
if ((x>60) && (x<80) && (y>200) && (y<240)) // button: - FRONT
digitalWrite(voordown, LOW);
myGLCD.print(“FRONT -”,245,140);
myGLCD.print(” “,245,140);
digitalWrite(voordown, HIGH);
if ((x>170) && (x<190) && (y>140) && (y<160)) // button: + REAR
digitalWrite(achterup, LOW);
myGLCD.print(“REAR +”,245,140);
myGLCD.print(” “,245,140);
digitalWrite(achterup, HIGH);
if ((x>170) && (x<190) && (y>210) && (y<230)) // button: - REAR
digitalWrite(achterdown, LOW);
myGLCD.print(“REAR -”,245,140);
myGLCD.print(” ",245,140);
digitalWrite(achterdown, HIGH);


Welcome to the Forum. Please read these three posts:

How to use this forum - please read.
Read this before posting a programming question … and
Planning and Implementing an Arduino Program

You have posted code without using code tags. The code tags make the code look

like this

when posting source code files. It makes it easier to read, and can be copied with a single mouse click. Also, if you don’t do it, some of the character sequences in the code can be misinterpred by the forum code as italics or funny emoticons.
If you have already posted without using code tags, open your message and select “modify” from the pull down menu labelled, “More”, at the lower left corner of the message. Highlight your code by selecting it (it turns blue), and then click on the “</>” icon at the upper left hand corner. Click on the “Save” button. Code tags can also be inserted manually in the forum text using the code and /code metatags.

Unless the sketch is too large, it’s better if you post your code, rather than attach it. When it’s attached, we have to download it, create a folder then open your code in our IDE. And afterwards, the folder remains unless we navigate to the “Temp” folder and manually remove it. It’s much easier to just view the code in your post.

Many questions can be answered by reading the documentation which is provided with the IDE, available under the help tab, or online here.

There are many other things that programmers do to make their code understandable. Please do them, as a courtesy to the members who volunteer their time to help you here. One is to use a standard indentation to clearly show the code blocks. Never put more than one statement per line. Place any brackets by themselves on a separate line. Before posting the code, use Ctrl-T in the IDE to reformat the code in a standard format, which makes it easier for us to read. Another is to give things descriptive names. You can name numerical constants, pin numbers, variables and many other things in this way. For example, you can refer to a pin and an output level by number, like digitalWrite(3,0). But such a statement doesn’t reveal anything about the purpose. digitalWrite(hornRelayPin, LOW) does. You can do that by declaring const byte hornRelayPin = 3; before setup() in your program. Many such names are already defined for you by the compiler and the Arduino IDE. Here are some:

#define HIGH 0x1
#define LOW  0x0
#define PI 3.1415926535897932384626433832795

Use them. There are many more. Use compiler math to compute values so you can see where they came from (or at least document them). For example, if you see the number 73, you would be hard put to explain the significance of it. But if you see “daysPerYear/5”, it is obvious. One more thing. When you work on program continuously, you become familiar with it. So many things seem obvious even if they are not spelled out explicitly. But try looking at your own code six months later. It will be as if a stranger wrote it. So write for strangers, not yourself.