-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing multiple positioned text items and writing all new ones #129
Comments
The only way to properly clear the screen is with it blinking twice as you say. You could try and write the inverse colour of the original to the same space but I think that might cause some ghosting and wouldn't give a truly clear screen. |
Do you think the library could be improved, to possibly allow it to clear and replace the screen contents in one action? I am just thinking on my Kindle, there isn't a big double flash like that when I switch pages. |
It's a hardware limitation not a software limitation so I don't think there is anything we can do. Unless @repaper or @tvoverbeek or @francesco-vannini have any ideas? |
I notice that this code in textpos.py seems to write a new image and then clear the display?
Shouldn't just one of these be necessary? |
@eat-sleep-code are you seeing a specific error with part of this code? |
No error, just trying to track down why there are multiple flashes between each update. If I look at how my Kindle Paperwhite (understand that the hardware is different, but both are e-ink so should operate roughly the same) there is a single flash between updates, not multiple. In the above code -- from my understanding -- a white image is being written to the screen (that write would cause one "flash" as that image is written) and then the core EPD clear is being called (that clear would cause a second "flash" as the screen is being cleared). |
What coffee are you running that is causing the behaviour you are seeing? Need to be able to replicate it. |
*code |
Well it is a dark roast. ;-) I will post the code into a repo tonight. |
Thanks very much that'll be great |
Here you go: https://github.com/eat-sleep-code/baseball-pi Note: To see this in action, find a team that currently has a game in progress: https://www.mlb.com/ |
@eat-sleep-code and which line in there is the issue? |
In baseball-pi/baseball/functions.py -- which I just cleaned up a bit... Look at the You will see I perform a When a game for the selected team is in session, In between each screen being displayed the screen flashes multiple times before the content is written. I would think you should just see one flash of it being cleared, and then the content should be written. |
To achieve what you want, use partial_update.
Instead of display.Clear() only create an empty image and zero the
dictionary.(only lines 170-171 of Clear() in textpos.py)
When calling WriteAll use WriteAll(partial_update=True).
Look at the code for the clock or the game of life demo for a demo of
partial update,
Hope this helps
Ton van Overbeek
(Currently no access to RPi/PaPiRus since holidaying down under)
…On 30 June 2017 at 05:05, eat-sleep-code ***@***.***> wrote:
In baseball-pi/baseball/functions.py
<https://github.com/eat-sleep-code/baseball-pi/blob/master/baseball/baseball.py>
-- which I just cleaned up a bit...
Look at the displayBoxScore (line 135), displayPitch (line 161), or
displayPlay (line 176).
You will see I perform a display.Clear() near the beginning and a
display.WriteAll() at the end of each of these.
When a game for the selected team is in session, displayInGame (line 210)
cycles through these methods every "5 seconds".
In between each screen being displayed the screen flashes multiple times
before the content is written.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#129 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABJE7sQTYJuK65uB4W4UktSrfPq6t1K9ks5sI_WCgaJpZM4N8ESi>
.
|
When I tried this I get the following error:
|
Try WriteAll(True) instead. Look at the definition of WriteAll in
papirus/textpos.py.
…On Jul 2, 2017 12:32, "eat-sleep-code" ***@***.***> wrote:
When I tried this I get the following error:
TypeError: WriteAll() got an unexpected keyword argument 'partial_update'
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#129 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABJE7jv6_dIPTWeduuURm8dj7rlq3VCMks5sJwFPgaJpZM4N8ESi>
.
|
Actually, I discovered I had a slightly older version of the library. |
I have a program that alternates between three screens.
Each of these screens has multiple items that are positioned at various places on the screen.
How do I smoothly clear the screen, and then write the next one.
I tried
display.Clear()
and then (after a bunch ofdisplay.AddText
s) adisplay.WriteAll()
but this causes the screen to blink twice between each screen.I tried a bunch of
display.RemoveText('ID')
and then (after a bunch ofdisplay.AddText
s) adisplay.WriteAll()
but this leaves large chunks of unwritten screen.So, what is the cleanest and quickest way to accomplish a Write of all new positioned text?
The text was updated successfully, but these errors were encountered: