Arduino Due TouchScreen,JoyStick - Circle flickers constantly

Hi,

I have a joystick and a touch screen (2,8 inch/ILI9341) connected to the Arduino Due.

I want to control the circle with the joystick via the touch screen, but if I do nothing then the circle flickers permanently.

Can someone give me a hint - why - and if my code contains an error ?

Thanks :slight_smile:

Grüße
Chris

#include <MCUFRIEND_kbv.h>

MCUFRIEND_kbv tft;

#define x 10
#define y 11

void setup() {
 pinMode(x, INPUT);
 pinMode(y,INPUT);

 tft.reset();
 tft.begin(0x9341);
 tft.setRotation(1);
}

void loop() {
int nx,ny;
nx = analogRead(x)-600;
ny = analogRead(y)-640;

tft.drawCircle(nx,ny,25,0x001F);  
tft.fillScreen(0x0000);
  
}

Did you buy or build this?
Please product link or a schematic, as the case may be.

I built it.

Joystick pins -> Arduino Due
VRx -> PIN 10
VRy -> PIN 11

touchscreen is plugged Arduino Due

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.