Page 1 of 1

Glcd (ks0108) printing new line and earesing old line.

Posted: Sat Aug 23, 2014 10:56 pm
by Jordy101091
Hi all,

I have a question and I can't seem to figure out how to approach this problem.
I'm working on a analog clock type display. I have figured out how to print the clock handles and such.
They are moving as well but I don't know how to delete the previous printed pixels.
Without clearing the whole screen.

I have tried to change the foreground color in flowcode to print the same line in white pixels.
But doesn't seem to work in simulation.
Or doesn't this option show up in simulation mode.

Let me know what you all think.

Regards jordy

Re: Glcd (ks0108) printing new line and earesing old line.

Posted: Sun Aug 24, 2014 6:43 am
by STibor
Hi!

Draw a sketch of the previous background color.

Re: Glcd (ks0108) printing new line and earesing old line.

Posted: Sun Aug 24, 2014 1:07 pm
by dazz
Hi Jordy
I've read a post from Benj on the forum (cant find it now), where from memory he says to simply blank out the pixels you just wrote, then send the next set of pixels,i assume your clock gave will be fixed so try resending the last hand update using the background colour, then send the next hand pos etc

print hand in foreground colour
delay
resend last print hand in background colour etc

hope it helps

Regards
Dazz

Re: Glcd (ks0108) printing new line and earesing old line.

Posted: Wed Sep 24, 2014 3:44 pm
by Benj
Hello,

For an analogue clock something like this should work well.

Loop Start

Clear Hour Hand - Draw previous hour position in BG colour
Clear Minute Hand - Draw previous min position in BG colour

Draw current Minute hand - Draw current min position in FG colour
Draw current Hour hand - Draw current hour position in FG colour

update prev values with current values

Small delay, maybe calculate all your current angles here to speed up draw times.

Loop End

If you use a timer interrupt in the background to measure the passing of time and update your sec, min and hour variables then it should all work nicely.