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

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

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

Post 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
the will to learn, should not be stopped by any price

User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

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

Post by STibor »

Hi!

Draw a sketch of the previous background color.
Attachments
draw_clear.fcfx
(8.67 KiB) Downloaded 240 times

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

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

Post 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
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

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

Post 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.

Post Reply