Serial control of frameRate
in
Integration and Hardware
•
2 years ago
Hello,
I'm a bit new to Processing, but I think I understand the general format. I am trying to use a serial input from arduino to control the frameRate on an animated gif. I tried making a loop that would increment the frameRate each time the sequence loads, but this didn't work and when I print out the frameRate() value it always returns 10.
Am I doing something, or is it not possible to change the frameRate like this? Could I use a delay in the loop instead?
Thanks!
I am working off of the Sequence Animation example:
for ( int i=1; i< 5; i++){
frameRate(i);
images[0] = loadImage("PT_anim0000.gif");
images[1] = loadImage("PT_anim0001.gif");
images[2] = loadImage("PT_anim0002.gif");
images[3] = loadImage("PT_anim0003.gif");
images[4] = loadImage("PT_anim0004.gif");
images[5] = loadImage("PT_anim0005.gif");
images[6] = loadImage("PT_anim0006.gif");
images[7] = loadImage("PT_anim0007.gif");
images[8] = loadImage("PT_anim0008.gif");
images[9] = loadImage("PT_anim0009.gif");
images[10] = loadImage("PT_anim0010.gif");
images[11] = loadImage("PT_anim0011.gif");
println(i);
//delay(10000- (i *100));
println(frameRate);
}
1