Hi everyone. I have spent 2 days trying to search for an answer to this one, but alas I have been able to resolve my problem.
I have Separate Images that I want to switch between White and Black but at different intervals. If I run each separately they work fine, but as soon as I try to run more than one the DELAY interferes with the other one.
I have also tried mills and still getting a pause which shouldn’t be there. (Not too hot on the mills timing function)
This is the First Set of Images (2 Small Circles that alternate between White & Black) works great with the Delay Function.
2 Sets of 2 Dots (first Set White and Black, Second Set Black & White, gives the Visual Impression they are Alternating from one to the Other.
display.fillCircle(display.width()/2+45, display.height()/2+25, 5, WHITE); //First Flashing Dot
display.fillCircle(display.width()/2+55, display.height()/2+25, 5, BLACK); //Second Flashing Dot
display.display();
delay(75); //Pause for Flashing Image
display.fillCircle(display.width()/2+45, display.height()/2+25, 5, BLACK); //First Flashing Dot
display.fillCircle(display.width()/2+55, display.height()/2+25, 5, WHITE); //Second Flashing Dot
display.display();
delay(75); //Pause for Flashing Image
The other code is for a set of 8 Small Rectangles that again have the odd one as Black to give the Impression of Flashing Lights in a Random Sequence.
// Start of First Set
display.fillRect(112, 3, 5,5, WHITE); // 1
display.fillRect(120, 3, 5,5, BLACK); // 2
display.fillRect(112, 11, 5,5, WHITE); // 3
display.fillRect(120, 11, 5,5, WHITE); // 4
display.fillRect(112, 19, 5,5, WHITE); // 5
display.fillRect(120, 19, 5,5, WHITE); // 6
display.fillRect(112, 27, 5,5, WHITE); // 7
display.fillRect(120, 27, 5,5, WHITE); // 8
display.display();
delay(75); //Pause for Flashing Image
//End of First Set
//Start of Second Set
display.fillRect(112, 3, 5,5, WHITE); // 1
display.fillRect(120, 3, 5,5, WHITE); // 2
display.fillRect(112, 11, 5,5, WHITE); // 3
display.fillRect(120, 11, 5,5, WHITE); // 4
display.fillRect(112, 19, 5,5, BLACK); // 5
display.fillRect(120, 19, 5,5, WHITE); // 6
display.fillRect(112, 27, 5,5, WHITE); // 7
display.fillRect(120, 27, 5,5, WHITE); // 8
display.display();
delay(75); //Pause for Flashing Image
//End of Second Set
//Start of Third Set
display.fillRect(112, 3, 5,5, BLACK); // 1
display.fillRect(120, 3, 5,5, WHITE); // 2
display.fillRect(112, 11, 5,5, BLACK); // 3
display.fillRect(120, 11, 5,5, WHITE); // 4
display.fillRect(112, 19, 5,5, WHITE); // 5
display.fillRect(120, 19, 5,5, WHITE); // 6
display.fillRect(112, 27, 5,5, BLACK); // 7
display.fillRect(120, 27, 5,5, WHITE); // 8
display.display();
delay(75); //Pause for Flashing Image
//End of Third Set
//Start of Forth Set
display.fillRect(112, 3, 5,5, WHITE); // 1
display.fillRect(120, 3, 5,5, WHITE); // 2
display.fillRect(112, 11, 5,5, WHITE); // 3
display.fillRect(120, 11, 5,5, BLACK); // 4
display.fillRect(112, 19, 5,5, WHITE); // 5
display.fillRect(120, 19, 5,5, BLACK); // 6
display.fillRect(112, 27, 5,5, WHITE); // 7
display.fillRect(120, 27, 5,5, WHITE); // 8
display.display();
delay(75); //Pause for Flashing Image
//End of Fourth
//Start of Fith Set
display.fillRect(112, 3, 5,5, WHITE); // 1
display.fillRect(120, 3, 5,5, BLACK); // 2
display.fillRect(112, 11, 5,5, WHITE); // 3
display.fillRect(120, 11, 5,5, BLACK); // 4
display.fillRect(112, 19, 5,5, WHITE); // 5
display.fillRect(120, 19, 5,5, BLACK); // 6
display.fillRect(112, 27, 5,5, WHITE); // 7
display.fillRect(120, 27, 5,5, WHITE); // 8
display.display();
delay(75); //Pause for Flashing Image
//End of Fith Set
//Start of Sith Set
display.fillRect(112, 3, 5,5, WHITE); // 1
display.fillRect(120, 3, 5,5, WHITE); // 2
display.fillRect(112, 11, 5,5, BLACK); // 3
display.fillRect(120, 11, 5,5, WHITE); // 4
display.fillRect(112, 19, 5,5, WHITE); // 5
display.fillRect(120, 19, 5,5, WHITE); // 6
display.fillRect(112, 27, 5,5, WHITE); // 7
display.fillRect(120, 27, 5,5, BLACK); // 8
display.display();
delay(75); //Pause for Flashing Image
//End of Sith Set
This again runs fine if on its own, but as soon as try to run both at the same time I get problems with Delay and a Pause.
I will also have another couple of Lines that will need to be sort of animated, moved in different places to look like a Sweeping Hand
This is all being Displayed on SS1306 128x64 OLED Screen
Any Help would be Much Apprieciated
Test.ino (10.4 KB)