Page 1 of 1

Newbie question - do I draw each frame

Posted: Fri Oct 13, 2017 1:31 am
by dangerflite
Using an Arduino Nano.

Hi all,

Is it OK to re-draw display elements every frame (loop) or should I schedule drawing only as required? Will clearing the screen and re-drawing the elements every frame cause the display to flicker?

I am designing a gauge - as the gauge 'decreases' should I re-draw elements in black to remove them or is there a way to destroy those elements, ie. remove a line drawn with drawLine();?

Thanks,
DF

Re: Newbie question - do I draw each frame

Posted: Wed Oct 18, 2017 11:53 pm
by nickwest
Try it! You won't break anything. If you have an oscilloscope you could set a pin high at the start of a drawing operation and then low at the end. Use your oscilloscope to measure the duration... because you can't always trust your eyes :-) Alternatively you could use a technique like at https://stackoverflow.com/questions/103 ... -execution or https://learn.sparkfun.com/tutorials/da ... in-arduino .