Getting 2 Separate Graphic Images to Flash Independently.

Another idea ! can you modify the bargraph() function to take arguments for the horizontal offset (the 'x' value) so you could use it to draw several next to each other ?

Hi Deva_Rishi, what can I say, you are a blooming genius******

I have attached a Video showing it working.....

I had to move the Drawing of the Bar Graph from a into Setup as it want showing for some reason, but that was simple enough.

I can now try to do the Rotating line in the Centre of the Reticle. (I have started playing with this....

Yes I will look at changing the speed but at the Moment IT WORKS!!!! and you know what they say? If it ain't broke don't fix it..... LOL

I can't thank you enough for what you have done, and all your help. It must be great to be able to Program like you do, but at 60 I'm a little too old to learn it all, I'm now more of a Copy & Paste Guy...

I do try to work out what parts of the program do what and in most cases do find a way, but as for understating the whole Programming Language... I'm useless.

Anyway thanks again.

I'm sure I will be back on here for more help in the not too distance future..

Happy Christmas by the way.

All the best

Phil

Forgot to add video of it Working

Video - http://www.bwof.co.uk/SCOPE4.MOV

philipedwards:
and you know what they say? If it ain't broke don't fix it..... LOL

No but can fiddle with it and see what that does. Create more then one bar and have them run at different speeds etc...

philipedwards:
It must be great to be able to Program like you do, but at 60 I'm a little too old to learn it all, I'm now more of a Copy & Paste Guy...

Well after playing with it for a while, reading a book on C++ programming can be a real help to make the next step, age is not a factor, only death is.

Hi again, quick update,

I have been playing around and I think I have managed to get each part to have its own Speed setting, which can be changed if needed.

Possibly not the best way to do it, but it appears to work!

Here is what I have done - Attached

Thanks again

Regards Phil

NEW_TEST.ino (12.2 KB)

yep that's perfect !
FYI, the Bargraph frame, could have just been created by calling 'my' Bargraph()
just like this within setup() bargraphstate=Bargraph(bargraphstate); but what you did also works just fine.
Since the call to display.display();probably takes quite a bit of time and you don't want to do it when it is not necessary, you could do something like this

void loop()  {
  bool dodisplay=false;  
  if (lastmomentbargraph + BARGRAPHSPEED <millis()) {
    bargraphstate=Bargraph(bargraphstate);
    lastmomentbargraph=millis();
    dodisplay=true;   
  } 
  if (lastmomentdots + DOTSSPEED <millis()) {
    twindotstate=Twin_Dots(twindotstate);
    lastmomentdots=millis();
    dodisplay=true;   
  }      
  if (lastmomentsquares + SQUARESSPEED <millis()) {
    flashsquarestate=Flashing_Squares(flashsquarestate);
    lastmomentsquares=millis(); 
    dodisplay=true;  
  } 
  if (lastmomentnumbers + RANDOMNUMBERSSPEED <millis()) {
    randomnumbersstate=Random_Numbers(randomnumbersstate);
    lastmomentnumbers=millis(); 
    dodisplay=true;   
  }
  if (dodisplay) display.display();
}

Deva_Rishi:
if (lastmomentbargraph + BARGRAPHSPEED <millis()) {
}
if (lastmomentdots + DOTSSPEED <millis()) {
}
if (lastmomentsquares + SQUARESSPEED <millis()) {
}
if (lastmomentnumbers + RANDOMNUMBERSSPEED <millis()) {
}

Those all have a rolloever problem. Granted, it will only happen every ~49 days, but still better not to code problems. The safe way to deal with millis() is elapsed time only.