Well, I was programming and testing stuff and accidentally created an image that literally destroys the touch screen.
PImage img;
boolean draw=true;
void setup(){
img=new PImage(min(width,height),min(width,height));
img.loadPixels();
for(int i=0;i<img.pixels.length;i++){
if((i%img.width+i/img.width)%2==0)
img.pixels[i]=color(255);
else
img.pixels[i]=color(0);
}
img.updatePixels();
}
void draw(){
background(200);
imageMode(CENTER);
if(draw)
image(img,width/2,height/2);
fill(0);
textSize(40);
textAlign(CENTER,CENTER);
text(touches.length,width*0.5f,height*0.2f);
fill(0,0,255,100);
noStroke();
for(int i=0;i<touches.length;i++){
ellipse(touches[i].x,touches[i].y,100,100);
}
}
void keyPressed(){
draw=!draw;
}
It’s basically just a checkered pattern of white and black pixels. But when I display it on the screen, the sensor stops working, not the program itself but the phone sensor.
I’m wondering why this is happening? Or maybe I’m the only one with this problem?
I’m using xiaomi redmi 7, android 10, miui 11.