How can I display an image in draw() successively with a delay between them?
PImage img1;
PImage img2;
void setup () {
img1 = loadImage("step5.png");
img2 = loadImage("fail2.png");
size(801,583);
background(#B70F0F);
delay(2000);
}
void draw (){
background(img1);
delay(2000);
background(img2);
delay(2000);
}
When i run this it shows the background colour from setup() after 2 seconds, then it runs for 4 seconds and shows the secend image (img2). How can I just show an image and then another one? I need something similar for a project, where I want to show certain images when certain inputs come from a serial port. That works with console messages (println()), but if I let the program show images instead it runs to the end and only shows the last image.